diff mbox series

[2/2] public: misra rule 20.7 fix on memory.h

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

Commit Message

Luca Fancellu Dec. 21, 2022, 9:57 a.m. UTC
Cppcheck has found a violation of rule 20.7 for the macro
XENMEM_SHARING_OP_FIELD_MAKE_GREF, the argument "val" is used in an
expression, hence add parenthesis to the argument "val" to fix the
violation.

Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/public/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 29cf5c823902..c5f0d31e235d 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -485,7 +485,7 @@  DEFINE_XEN_GUEST_HANDLE(xen_mem_access_op_t);
 #define XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG   (xen_mk_ullong(1) << 62)
 
 #define XENMEM_SHARING_OP_FIELD_MAKE_GREF(field, val)  \
-    (field) = (XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG | val)
+    (field) = (XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG | (val))
 #define XENMEM_SHARING_OP_FIELD_IS_GREF(field)         \
     ((field) & XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG)
 #define XENMEM_SHARING_OP_FIELD_GET_GREF(field)        \