qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: Improve macro parenthesizat


From: Cédric Le Goater
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: Improve macro parenthesization
Date: Tue, 19 Sep 2017 17:22:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 09/19/2017 04:16 PM, 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.

yes.

> Signed-off-by: Eric Blake <address@hidden>

Reviewed-by: Cédric Le Goater <address@hidden>

C.
> ---
>  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
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]