mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
9106769ea9
commit
e51649b4c2
2 files changed
+3
-3
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||