diff mbox series

[RFC,12/18] arm: cppcheck: misra rule 20.7 deviation on asm/arm64/sysregs.h

Message ID 20221220085100.22848-13-luca.fancellu@arm.com (mailing list archive)
State Superseded
Headers show
Series cppcheck rule 20.7 fixes | expand

Commit Message

Luca Fancellu Dec. 20, 2022, 8:50 a.m. UTC
Cppcheck has found a violation of rule 20.7 for the macro
WRITE_SYSREG64, the macro parameter "v" is never used in an
expression, but adding parenthesis to it doesn't harm the code
or the readability, so add parenthesis to it.

Eclair and coverity does not report this finding.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/arm/include/asm/arm64/sysregs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index 463899951414..3f709d26a299 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -461,7 +461,7 @@ 
 /* Access to system registers */
 
 #define WRITE_SYSREG64(v, name) do {                    \
-    uint64_t _r = v;                                    \
+    uint64_t _r = (v);                                  \
     asm volatile("msr "__stringify(name)", %0" : : "r" (_r));       \
 } while (0)
 #define READ_SYSREG64(name) ({                          \