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 | 6fb0022b48c6f646f5bd5178152efe7e2398dd41 (patch) | |
tree | af89e13196284f3c8f2bf2d70422ce6f73ffd01b /block/dmg.c | |
parent | 668c2d1f91f467ae718fc3e03cffed25ade8bfce (diff) | |
download | qemu-6fb0022b48c6f646f5bd5178152efe7e2398dd41.zip qemu-6fb0022b48c6f646f5bd5178152efe7e2398dd41.tar.gz qemu-6fb0022b48c6f646f5bd5178152efe7e2398dd41.tar.bz2 |
dmg: 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>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'block/dmg.c')
-rw-r--r-- | block/dmg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/dmg.c b/block/dmg.c index 900ae5a..6c0711f 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 |