]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
arm/public: address violations of MISRA C Rule 20.7
authorNicola Vetrini <nicola.vetrini@bugseng.com>
Fri, 29 Mar 2024 09:11:30 +0000 (10:11 +0100)
committerStefano Stabellini <stefano.stabellini@amd.com>
Fri, 5 Apr 2024 18:15:47 +0000 (11:15 -0700)
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>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/public/arch-arm.h

index a25e87dbda3a0b4536a62c5c43cdd909767be120..e167e14f8df96578a8242a89ef5c15a47607cb47 100644 (file)
     do {                                                    \
         __typeof__(&(hnd)) _sxghr_tmp = &(hnd);             \
         _sxghr_tmp->q = 0;                                  \
-        _sxghr_tmp->p = val;                                \
+        _sxghr_tmp->p = (val);                              \
     } while ( 0 )
 #define set_xen_guest_handle(hnd, val) set_xen_guest_handle_raw(hnd, val)