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

[xen master] xen/arm: regs: Fix MISRA C 2012 Rule 20.7 violation



commit ea2353a7fbdabeb5f698ac53579dec1c8ea9f77a
Author:     Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
AuthorDate: Mon Aug 8 12:48:37 2022 +0300
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Tue Aug 9 14:47:47 2022 -0700

    xen/arm: regs: Fix MISRA C 2012 Rule 20.7 violation
    
    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@xxxxxxxxx>
    Reviewed-by: Rahul Singh <rahul.singh@xxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/arch/arm/include/asm/regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/regs.h b/xen/arch/arm/include/asm/regs.h
index 794721a103..0693a68131 100644
--- a/xen/arch/arm/include/asm/regs.h
+++ b/xen/arch/arm/include/asm/regs.h
@@ -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)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.