qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
	Alexander Graf <agraf@suse.de>,
	"open list:PowerPC" <qemu-ppc@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] ppc/pnv: Improve macro parenthesization
Date: Wed, 20 Sep 2017 11:00:24 +1000	[thread overview]
Message-ID: <20170920010024.GB5520@umbus.fritz.box> (raw)
In-Reply-To: <20170919141603.27713-1-eblake@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

On Tue, Sep 19, 2017 at 09:16:03AM -0500, Eric Blake wrote:
> Although none of the existing macro call-sites were broken,
> it's always better to write macros that properly parenthesize
> arguments that can be complex expressions, so that the intended
> order of operations is not broken.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>

Applied to ppc-for-2.11, thanks.

> ---
>  include/hw/ppc/pnv_xscom.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
> index 3757b2cab9..38077b4796 100644
> --- a/include/hw/ppc/pnv_xscom.h
> +++ b/include/hw/ppc/pnv_xscom.h
> @@ -54,7 +54,7 @@ typedef struct PnvXScomInterfaceClass {
>   *   PCB SLAVE   0x110Fxxxx
>   */
> 
> -#define PNV_XSCOM_EX_CORE_BASE(base, i) (base | (((uint64_t)i) << 24))
> +#define PNV_XSCOM_EX_CORE_BASE(base, i) ((base) | ((uint64_t)(i) << 24))
>  #define PNV_XSCOM_EX_CORE_SIZE    0x100000
> 
>  #define PNV_XSCOM_LPC_BASE        0xb0020

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2017-09-20  2:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 14:16 [Qemu-devel] [PATCH] ppc/pnv: Improve macro parenthesization Eric Blake
2017-09-19 15:22 ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2017-09-20  1:00 ` David Gibson [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=20170920010024.GB5520@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-trivial@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).