From: Marc-André Lureau Date: Thu, 22 Jun 2017 11:04:16 +0000 (+0200) Subject: qcow2: use DIV_ROUND_UP X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=21cf3e120191eb1302da2bbfc6c41239e0d84db7;p=qemu.git qcow2: 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 Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index f06c08f64c..30db942dde 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -61,7 +61,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size, new_l1_size = 1; } while (min_size > new_l1_size) { - new_l1_size = (new_l1_size * 3 + 1) / 2; + new_l1_size = DIV_ROUND_UP(new_l1_size * 3, 2); } }