diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-06-22 13:04:16 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-08-31 12:29:07 +0200 |
commit | 69db8dfc19cd0aff951c63a4ec1f1ed26417a4fc (patch) | |
tree | 4097fba4113d9d8d7dd33f08040dda34ae9bcf68 | |
parent | e5f99037481ba405cd6c3b2beaa2b786a5c68100 (diff) |
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>
-rw-r--r-- | monitor.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |