From: Paolo Bonzini <pbonzini@redhat.com>
To: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] exec: use macro for alignment
Date: Thu, 23 Jul 2015 12:43:25 +0200 [thread overview]
Message-ID: <55B0C54D.7000005@redhat.com> (raw)
In-Reply-To: <1437646847-3015-1-git-send-email-chenhanxiao@cn.fujitsu.com>
On 23/07/2015 12:20, Chen Hanxiao wrote:
>
> +#define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1))
> +
> static void *file_ram_alloc(RAMBlock *block,
> ram_addr_t memory,
> const char *path,
> @@ -1207,7 +1209,7 @@ static void *file_ram_alloc(RAMBlock *block,
> unlink(filename);
> g_free(filename);
>
> - memory = (memory+hpagesize-1) & ~(hpagesize-1);
> + memory = ALIGN(memory, hpagesize);
>
Hi,
the patch is a good idea, but please use ROUND_UP instead of defining
your own ALIGN macro.
Thanks!
Paolo
prev parent reply other threads:[~2015-07-23 10:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 10:20 [Qemu-devel] [PATCH] exec: use macro for alignment Chen Hanxiao
2015-07-23 10:43 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55B0C54D.7000005@redhat.com \
--to=pbonzini@redhat.com \
--cc=chenhanxiao@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).