aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Hanxiao <chenhanxiao@cn.fujitsu.com>2015-07-24 11:12:03 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2015-08-14 23:40:32 +0200
commit9284f31994919c001b54af57fc7d1bbb0d19b6fd (patch)
tree5b58ddff5ac997559c47217033255169afa6bc33
parentc097a60b100c10d79d8bd5c91ce804e865d7e70b (diff)
downloadqemu-9284f31994919c001b54af57fc7d1bbb0d19b6fd.zip
qemu-9284f31994919c001b54af57fc7d1bbb0d19b6fd.tar.gz
qemu-9284f31994919c001b54af57fc7d1bbb0d19b6fd.tar.bz2
exec: use macro ROUND_UP for alignment
Use ROUND_UP instead. Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> Message-Id: <1437707523-4910-1-git-send-email-chenhanxiao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index 0a4a0c5..54cd70a 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