[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] xen/cpu: fix MISRA C 2012 Rule 20.7 violation
commit e99709a86d59b3a9319f7b00880abd23c62251f1 Author: Xenia Ragiadakou <burzalodowa@xxxxxxxxx> AuthorDate: Tue Aug 9 11:51:14 2022 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Tue Aug 9 11:51:14 2022 +0200 xen/cpu: fix MISRA C 2012 Rule 20.7 violation In MASK_DECLARE_ macros, the macro parameter 'x' is used as expression and therefore it is good to be enclosed in parentheses to prevent against unintended expansions. Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx> While there add the blanks missing around the + operators involved. Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx> --- xen/common/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/common/cpu.c b/xen/common/cpu.c index b0b63cdb36..4bdb017b0e 100644 --- a/xen/common/cpu.c +++ b/xen/common/cpu.c @@ -25,10 +25,10 @@ const cpumask_t cpumask_all = { */ /* cpu_bit_bitmap[0] is empty - so we can back into it */ -#define MASK_DECLARE_1(x) [x+1][0] = 1UL << (x) -#define MASK_DECLARE_2(x) MASK_DECLARE_1(x), MASK_DECLARE_1(x+1) -#define MASK_DECLARE_4(x) MASK_DECLARE_2(x), MASK_DECLARE_2(x+2) -#define MASK_DECLARE_8(x) MASK_DECLARE_4(x), MASK_DECLARE_4(x+4) +#define MASK_DECLARE_1(x) [(x) + 1][0] = 1UL << (x) +#define MASK_DECLARE_2(x) MASK_DECLARE_1(x), MASK_DECLARE_1((x) + 1) +#define MASK_DECLARE_4(x) MASK_DECLARE_2(x), MASK_DECLARE_2((x) + 2) +#define MASK_DECLARE_8(x) MASK_DECLARE_4(x), MASK_DECLARE_4((x) + 4) const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = { -- generated by git-patchbot for /home/xen/git/xen.git#staging
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |