From 6fb0022b48c6f646f5bd5178152efe7e2398dd41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 22 Jun 2017 13:04:16 +0200 Subject: [PATCH] dmg: use DIV_ROUND_UP MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson --- block/dmg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/dmg.c b/block/dmg.c index 900ae5a678..6c0711f563 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -111,7 +111,7 @@ static void update_max_chunk_size(BDRVDMGState *s, uint32_t chunk, uncompressed_sectors = s->sectorcounts[chunk]; break; case 1: /* copy */ - uncompressed_sectors = (s->lengths[chunk] + 511) / 512; + uncompressed_sectors = DIV_ROUND_UP(s->lengths[chunk], 512); break; case 2: /* zero */ /* as the all-zeroes block may be large, it is treated specially: the -- 2.11.0