]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/public: address violations of MISRA C Rule 20.7
authorNicola Vetrini <nicola.vetrini@bugseng.com>
Wed, 27 Mar 2024 08:12:58 +0000 (09:12 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 27 Mar 2024 08:12:58 +0000 (09:12 +0100)
MISRA C Rule 20.7 states: "Expressions resulting from the expansion
of macro parameters shall be enclosed in parentheses". Therefore, some
macro definitions should gain additional parentheses to ensure that all
current and future users will be safe with respect to expansions that
can possibly alter the semantics of the passed-in macro parameter.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/public/arch-x86/xen.h

index c0f4551247f467b30cb60485097cbf7e8dc9f089..a9a87d9b50de0b3856e55479294f2f67a3d37f25 100644 (file)
@@ -36,7 +36,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__)