projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fb0022
)
qcow2: use DIV_ROUND_UP
author
Marc-André Lureau
<marcandre.lureau@redhat.com>
Thu, 22 Jun 2017 11:04:16 +0000
(13:04 +0200)
committer
Marc-André Lureau
<marcandre.lureau@redhat.com>
Thu, 31 Aug 2017 10:29:07 +0000
(12:29 +0200)
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>
block/qcow2-cluster.c
patch
|
blob
|
history
diff --git
a/block/qcow2-cluster.c
b/block/qcow2-cluster.c
index f06c08f64c79ed13cb68934cdf75e7c4b406552f..30db942dde4869ea2e784ea9962740bb05f5202a 100644
(file)
--- 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)
;
}
}