Skip to content

Commit

Permalink
dmg: use DIV_ROUND_UP
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
elmarco committed Aug 31, 2017
1 parent 668c2d1 commit 6fb0022
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/dmg.c
Expand Up @@ -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
Expand Down

0 comments on commit 6fb0022

Please sign in to comment.