]> xenbits.xensource.com Git - xen.git/commitdiff
arm/gic: fix MISRA C 2012 Rule 20.7 violation
authorXenia Ragiadakou <burzalodowa@gmail.com>
Thu, 11 Aug 2022 09:48:12 +0000 (11:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 11 Aug 2022 09:48:12 +0000 (11:48 +0200)
In GIC_PRI_TO_GUEST(), add parentheses around the macro parameter 'pri' to
prevent against unintended expansions and realign comment.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/include/asm/gic.h

index b3c6c67933a4aaf6fc60f0e70f6ac1bcfc394265..3692fae3938122d6b724781cf895e1c748f5344c 100644 (file)
 #define GIC_PRI_IPI_ALL    ((GIC_PRI_IPI << 24) | (GIC_PRI_IPI << 16) |\
                             (GIC_PRI_IPI << 8) | GIC_PRI_IPI)
 
-#define GIC_PRI_TO_GUEST(pri) (pri >> 3) /* GICH_LR and GICH_VMCR only support
-                                            5 bits for guest irq priority */
+#define GIC_PRI_TO_GUEST(pri) ((pri) >> 3) /* GICH_LR and GICH_VMCR only support
+                                              5 bits for guest irq priority */
 
 #define GICH_LR_PENDING         1
 #define GICH_LR_ACTIVE          2