From c41a73ffaf40aadc2c1e038ae4d12b62cd578e7f Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 31 May 2016 18:35:53 +0200 Subject: qed: Use DIV_ROUND_UP Replace (((n) + (d) - 1) /(d)) by DIV_ROUND_UP(n,d). This patch is the result of coccinelle script scripts/coccinelle/round.cocci CC: qemu-block@nongnu.org Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- block/qed-check.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'block/qed-check.c') diff --git a/block/qed-check.c b/block/qed-check.c index 622f308976..dcd4f036b8 100644 --- a/block/qed-check.c +++ b/block/qed-check.c @@ -234,8 +234,7 @@ int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) } check.result->bfi.total_clusters = - (s->header.image_size + s->header.cluster_size - 1) / - s->header.cluster_size; + DIV_ROUND_UP(s->header.image_size, s->header.cluster_size); ret = qed_check_l1_table(&check, s->l1_table); if (ret == 0) { /* Only check for leaks if entire image was scanned successfully */ -- cgit v1.2.3