xen/arm: regs: Fix MISRA C 2012 Rule 20.7 violation
authorXenia Ragiadakou <burzalodowa@gmail.com>
Mon, 8 Aug 2022 09:48:37 +0000 (12:48 +0300)
committerStefano Stabellini <stefano.stabellini@amd.com>
Tue, 9 Aug 2022 21:47:47 +0000 (14:47 -0700)
In macro psr_mode(), the macro parameter 'm' is used as expression and
therefore it is good to be enclosed in parentheses to prevent against
unintended expansions.

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

index 794721a103a46e0fed338815752f8639d8aa6340..0693a681315f99e4346cbc4324acb5d6db1c394f 100644 (file)
@@ -11,7 +11,7 @@
 #include <asm/current.h>
 #include <asm/processor.h>
 
-#define psr_mode(psr,m) (((psr) & PSR_MODE_MASK) == m)
+#define psr_mode(psr,m) (((psr) & PSR_MODE_MASK) == (m))
 
 static inline bool regs_mode_is_32bit(const struct cpu_user_regs *regs)
 {