diff mbox series

[RFC,02/18] arm: cppcheck: misra rule 20.7 deviation on processor.h

Message ID 20221220085100.22848-3-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 __DECL_REG,
but the macro parameters are never used as an expression, they are
used for text substitution and adding parenthesis would break the
code. Cppcheck is not taking into account the context of use of the
macro argument, so we can suppress the finding.

Eclair and coverity does not report this finding.

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

Patch

diff --git a/xen/arch/arm/include/asm/arm64/processor.h b/xen/arch/arm/include/asm/arm64/processor.h
index c749f80ad91b..aacbe5d4d538 100644
--- a/xen/arch/arm/include/asm/arm64/processor.h
+++ b/xen/arch/arm/include/asm/arm64/processor.h
@@ -4,7 +4,7 @@ 
 #ifndef __ASSEMBLY__
 
 /* Anonymous union includes both 32- and 64-bit names (e.g., r0/x0). */
-
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define __DECL_REG(n64, n32) union {            \
     uint64_t n64;                               \
     uint32_t n32;                               \