diff mbox series

[RFC,15/18] public/x86: cppcheck: misra rule 20.7 deviation on xen-x86_64.h

Message ID 20221220085100.22848-16-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
__DECL_REG_LOHI, __DECL_REG_LO8 and __DECL_REG_LO16, but the macro
parameters are used as variable identifiers, so it is safe to
suppress the findings.

Eclair and coverity does not report these findings.

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

Patch

diff --git a/xen/include/public/arch-x86/xen-x86_64.h b/xen/include/public/arch-x86/xen-x86_64.h
index 5d9035ed2230..7e375cd6f45f 100644
--- a/xen/include/public/arch-x86/xen-x86_64.h
+++ b/xen/include/public/arch-x86/xen-x86_64.h
@@ -115,6 +115,7 @@  struct iret_context {
 
 #if defined(__XEN__) || defined(__XEN_TOOLS__)
 /* Anonymous unions include all permissible names (e.g., al/ah/ax/eax/rax). */
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define __DECL_REG_LOHI(which) union { \
     uint64_t r ## which ## x; \
     uint32_t e ## which ## x; \
@@ -124,12 +125,14 @@  struct iret_context {
         uint8_t which ## h; \
     }; \
 }
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define __DECL_REG_LO8(name) union { \
     uint64_t r ## name; \
     uint32_t e ## name; \
     uint16_t name; \
     uint8_t name ## l; \
 }
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
 #define __DECL_REG_LO16(name) union { \
     uint64_t r ## name; \
     uint32_t e ## name; \