@@ -14,6 +14,7 @@
/* Structural guest handles introduced in 0x00030201. */
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
+/* SAF-1-false-positive-cppcheck R20.7 argument as text substitution */
#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
typedef struct { type *p; } __guest_handle_ ## name
#else
@@ -36,7 +37,7 @@
#define __XEN_GUEST_HANDLE(name) __guest_handle_ ## name
#define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name)
#define XEN_GUEST_HANDLE_PARAM(name) XEN_GUEST_HANDLE(name)
-#define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = val; } while (0)
+#define set_xen_guest_handle_raw(hnd, val) do { (hnd).p = (val); } while (0)
#define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)
#if defined(__i386__)
Cppcheck has found violations of rule 20.7 for the macros ___DEFINE_XEN_GUEST_HANDLE and set_xen_guest_handle_raw. For the first one, the macro parameters are never used as an expression, so it is safe to suppress the finding. For the second one, while the argument "val" is never used in an expression, it doesn't harm the code or the readability, so add them. Eclair and coverity does not report these findings. Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> --- xen/include/public/arch-x86/xen.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)