xen/include: address violations of MISRA C Rule 20.7

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>
This commit is contained in:
Nicola Vetrini authored and Jan Beulich committed 2024-03-11 09:34:14 +01:00
1 parent 9106769ea9
commit e51649b4c2
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ struct bug_frame {
[bf_type] "i" (type), \
[bf_ptr] "i" (ptr), \
[bf_msg] "i" (msg), \
[bf_line_lo] "i" ((line & ((1 << BUG_LINE_LO_WIDTH) - 1)) \
[bf_line_lo] "i" (((line) & ((1 << BUG_LINE_LO_WIDTH) - 1)) \
<< BUG_DISP_WIDTH), \
[bf_line_hi] "i" (((line) >> BUG_LINE_LO_WIDTH) << BUG_DISP_WIDTH)
+2 -2
View File
@@ -63,9 +63,9 @@ typedef int (*initcall_t)(void);
typedef void (*exitcall_t)(void);
#define presmp_initcall(fn) \
const static initcall_t __initcall_##fn __init_call("presmp") = fn
const static initcall_t __initcall_##fn __init_call("presmp") = (fn)
#define __initcall(fn) \
const static initcall_t __initcall_##fn __init_call("1") = fn
const static initcall_t __initcall_##fn __init_call("1") = (fn)
#define __exitcall(fn) \
static exitcall_t __exitcall_##fn __exit_call = fn
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.