monitor: use DIV_ROUND_UP
I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
e5f9903748
commit
69db8dfc19
@ -1349,7 +1349,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,
|
|||||||
|
|
||||||
switch(format) {
|
switch(format) {
|
||||||
case 'o':
|
case 'o':
|
||||||
max_digits = (wsize * 8 + 2) / 3;
|
max_digits = DIV_ROUND_UP(wsize * 8, 3);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case 'x':
|
case 'x':
|
||||||
@ -1357,7 +1357,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,
|
|||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
case 'd':
|
case 'd':
|
||||||
max_digits = (wsize * 8 * 10 + 32) / 33;
|
max_digits = DIV_ROUND_UP(wsize * 8 * 10, 33);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
wsize = 1;
|
wsize = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user