diff mbox series

target/ppc/cpu.h: Put macro parameter in parentheses

Message ID 20200130021619.65FAB747871@zero.eik.bme.hu
State New
Headers show
Series target/ppc/cpu.h: Put macro parameter in parentheses | expand

Commit Message

BALATON Zoltan Jan. 30, 2020, 2:06 a.m. UTC
Fix PPC_INPUT macro to work with more complex expressions by
protecting its argument with parentheses.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 target/ppc/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Gibson Jan. 30, 2020, 4:24 a.m. UTC | #1
On Thu, Jan 30, 2020 at 03:06:18AM +0100, BALATON Zoltan wrote:
> Fix PPC_INPUT macro to work with more complex expressions by
> protecting its argument with parentheses.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

Pretty unlikely to break anything in practice, but applied nonetheless.

> ---
>  target/ppc/cpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index 8ebeaba649..e3a937e163 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -180,7 +180,7 @@ enum {
>      POWERPC_EXCP_TRAP          = 0x40,
>  };
>  
> -#define PPC_INPUT(env) (env->bus_model)
> +#define PPC_INPUT(env) ((env)->bus_model)
>  
>  /*****************************************************************************/
>  typedef struct opc_handler_t opc_handler_t;
diff mbox series

Patch

diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 8ebeaba649..e3a937e163 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -180,7 +180,7 @@  enum {
     POWERPC_EXCP_TRAP          = 0x40,
 };
 
-#define PPC_INPUT(env) (env->bus_model)
+#define PPC_INPUT(env) ((env)->bus_model)
 
 /*****************************************************************************/
 typedef struct opc_handler_t opc_handler_t;