[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] public: misra rule 20.7 fix on memory.h



commit ee17d521b808a918bec2a27bbeeebd0f1bb0303b
Author:     Luca Fancellu <luca.fancellu@xxxxxxx>
AuthorDate: Thu Dec 22 10:04:34 2022 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Dec 22 10:04:34 2022 +0100

    public: misra rule 20.7 fix on memory.h
    
    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@xxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/include/public/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 29cf5c8239..c5f0d31e23 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)        \
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.