xen/arm: regs: Fix MISRA C 2012 Rule 20.7 violation
PATCH 1/1 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 <[email protected]>
--- xen/arch/arm/include/asm/regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/include/asm/regs.h +1 -1
@@ -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) {
Signature · 1 line
2.34.1
Hi Xenia,
Quoted 7 lines · Xenia Ragiadakou
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 <[email protected]>
Reviewed-by Rahul Singh <[email protected]>
Regards,
Rahul
Quoted 5 lines · Xenia Ragiadakou
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 <[email protected]>
Reviewed-by Stefano Stabellini <[email protected]>
Quoted 20 lines
--- xen/arch/arm/include/asm/regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/arch/arm/include/asm/regs.h +1
-1@@ -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) {Signature · 1 line
2.34.1