From 69db8dfc19cd0aff951c63a4ec1f1ed26417a4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 22 Jun 2017 13:04:16 +0200 Subject: [PATCH] monitor: use DIV_ROUND_UP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson --- monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index e0f880107f..135ec2de8f 100644 --- a/monitor.c +++ b/monitor.c @@ -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;