mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
libelf: 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> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
d7c4d59b51
commit
8189230d80
2 files changed
+2
-2
No files matched your search
@@ -26,7 +26,7 @@
|
||||
/* we would like to use elf->log_callback but we can't because
|
||||
* there is no vprintk in Xen */
|
||||
#define elf_msg(elf, fmt, args ... ) \
|
||||
if (elf->verbose) printk(fmt, ## args )
|
||||
if ((elf)->verbose) printk(fmt, ## args )
|
||||
#define elf_err(elf, fmt, args ... ) \
|
||||
printk(fmt, ## args )
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ bool elf_access_ok(struct elf_binary * elf,
|
||||
#define elf_store_val(elf, type, ptr, val) \
|
||||
({ \
|
||||
typeof(type) elf_store__val = (val); \
|
||||
elf_ptrval elf_store__targ = ptr; \
|
||||
elf_ptrval elf_store__targ = (ptr); \
|
||||
if (elf_access_ok((elf), elf_store__targ, \
|
||||
sizeof(elf_store__val))) { \
|
||||
elf_memcpy_unchecked((void*)elf_store__targ, &elf_store__val, \
|
||||
|
||||