From 9284f31994919c001b54af57fc7d1bbb0d19b6fd Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Fri, 24 Jul 2015 11:12:03 +0800 Subject: exec: use macro ROUND_UP for alignment Use ROUND_UP instead. Signed-off-by: Chen Hanxiao Message-Id: <1437707523-4910-1-git-send-email-chenhanxiao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 0a4a0c5af6..54cd70ac1e 100644 --- a/exec.c +++ b/exec.c @@ -1210,7 +1210,7 @@ static void *file_ram_alloc(RAMBlock *block, unlink(filename); g_free(filename); - memory = (memory+hpagesize-1) & ~(hpagesize-1); + memory = ROUND_UP(memory, hpagesize); /* * ftruncate is not supported by hugetlbfs in older -- cgit v1.2.3