提交 69db8dfc 编写于 作者: M Marc-André Lureau

monitor: use DIV_ROUND_UP

I used the clang-tidy qemu-round check to generate the fix:
https://github.com/elmarco/clang-tools-extraSigned-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: NRichard Henderson <rth@twiddle.net>
上级 e5f99037
......@@ -1349,7 +1349,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,
switch(format) {
case 'o':
max_digits = (wsize * 8 + 2) / 3;
max_digits = DIV_ROUND_UP(wsize * 8, 3);
break;
default:
case 'x':
......@@ -1357,7 +1357,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,
break;
case 'u':
case 'd':
max_digits = (wsize * 8 * 10 + 32) / 33;
max_digits = DIV_ROUND_UP(wsize * 8 * 10, 33);
break;
case 'c':
wsize = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册