qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] exec: use macro ROUND_UP for alignment
@ 2015-07-24  3:12 Chen Hanxiao
  2015-07-28  8:11 ` Chen, Hanxiao
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Hanxiao @ 2015-07-24  3:12 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

Use ROUND_UP instead.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index 7d60e15..bb16c50 100644
--- a/exec.c
+++ b/exec.c
@@ -1207,7 +1207,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
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-28  8:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-24  3:12 [Qemu-devel] [PATCH v2] exec: use macro ROUND_UP for alignment Chen Hanxiao
2015-07-28  8:11 ` Chen, Hanxiao
2015-07-28  8:13   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).