diff mbox series

[4/7] xen/vgic: Fix MISRA C 2012 Rule 20.7 violation

Message ID 20220819194359.1196539-5-burzalodowa@gmail.com (mailing list archive)
State New, archived
Headers show
Series Fix MISRA C 2012 Rule 20.7 violations | expand

Commit Message

Xenia Ragiadakou Aug. 19, 2022, 7:43 p.m. UTC
In macro VGIC_V3_LR_INDEX(), add parentheses around the macro parameter
to prevent against unintended expansions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
---
 xen/arch/arm/include/asm/new_vgic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Stabellini Aug. 19, 2022, 10:16 p.m. UTC | #1
On Fri, 19 Aug 2022, Xenia Ragiadakou wrote:
> In macro VGIC_V3_LR_INDEX(), add parentheses around the macro parameter
> to prevent against unintended expansions.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/arch/arm/include/asm/new_vgic.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/include/asm/new_vgic.h b/xen/arch/arm/include/asm/new_vgic.h
> index ab57fcd91d..b7fa9ab11a 100644
> --- a/xen/arch/arm/include/asm/new_vgic.h
> +++ b/xen/arch/arm/include/asm/new_vgic.h
> @@ -43,7 +43,7 @@ enum vgic_type {
>  
>  #define VGIC_V2_MAX_LRS         (1 << 6)
>  #define VGIC_V3_MAX_LRS         16
> -#define VGIC_V3_LR_INDEX(lr)    (VGIC_V3_MAX_LRS - 1 - lr)
> +#define VGIC_V3_LR_INDEX(lr)    (VGIC_V3_MAX_LRS - 1 - (lr))
>  
>  #define VGIC_CONFIG_EDGE        false
>  #define VGIC_CONFIG_LEVEL       true
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/xen/arch/arm/include/asm/new_vgic.h b/xen/arch/arm/include/asm/new_vgic.h
index ab57fcd91d..b7fa9ab11a 100644
--- a/xen/arch/arm/include/asm/new_vgic.h
+++ b/xen/arch/arm/include/asm/new_vgic.h
@@ -43,7 +43,7 @@  enum vgic_type {
 
 #define VGIC_V2_MAX_LRS         (1 << 6)
 #define VGIC_V3_MAX_LRS         16
-#define VGIC_V3_LR_INDEX(lr)    (VGIC_V3_MAX_LRS - 1 - lr)
+#define VGIC_V3_LR_INDEX(lr)    (VGIC_V3_MAX_LRS - 1 - (lr))
 
 #define VGIC_CONFIG_EDGE        false
 #define VGIC_CONFIG_LEVEL       true