diff mbox series

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

Message ID 20221220085100.22848-4-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 violations of rule 20.7 for the macros RODATA_STR()
and ASM_INT(), but the macro parameters are never used as an
expression, they are used for text subtitution and cppcheck is not
taking into account the context of use for them, so we can suppress
the finding.

Eclair and coverity does not report these findings.

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

Patch

diff --git a/xen/arch/arm/include/asm/asm_defns.h b/xen/arch/arm/include/asm/asm_defns.h
index 29a9dbb002fa..9bf4cf8891f5 100644
--- a/xen/arch/arm/include/asm/asm_defns.h
+++ b/xen/arch/arm/include/asm/asm_defns.h
@@ -22,11 +22,13 @@ 
 # error "unknown ARM variant"
 #endif
 
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define RODATA_STR(label, msg)                  \
 .pushsection .rodata.str, "aMS", %progbits, 1 ; \
 label:  .asciz msg;                             \
 .popsection
 
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define ASM_INT(label, val)                 \
     .p2align 2;                             \
 label: .long (val);                         \