From d0448de7f661070fad1602218f1b7d211e1c2270 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 31 May 2016 18:35:56 +0200 Subject: xen: 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: Stefano Stabellini Signed-off-by: Laurent Vivier Reviewed-by: Stefano Stabellini Signed-off-by: Michael Tokarev --- xen-hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xen-hvm.c') diff --git a/xen-hvm.c b/xen-hvm.c index 01ee25d..a0da8d7 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -567,7 +567,7 @@ static void xen_sync_dirty_bitmap(XenIOState *state, { hwaddr npages = size >> TARGET_PAGE_BITS; const int width = sizeof(unsigned long) * 8; - unsigned long bitmap[(npages + width - 1) / width]; + unsigned long bitmap[DIV_ROUND_UP(npages, width)]; int rc, i, j; const XenPhysmap *physmap = NULL; -- cgit v1.1