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 | 21cf3e120191eb1302da2bbfc6c41239e0d84db7 (patch) | |
tree | 2ada62965407f8bbeea5e3811e2250864c66db83 /block | |
parent | 6fb0022b48c6f646f5bd5178152efe7e2398dd41 (diff) |
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 <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'block')
-rw-r--r-- | block/qcow2-cluster.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } } |