On 05.08.2022 10:43, Xenia Ragiadakou wrote:
> --- a/xen/common/cpu.c
> +++ b/xen/common/cpu.c
> @@ -25,7 +25,7 @@ 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_1(x) [(x)+1][0] = 1UL << (x)
If you adjust these, you also ...
> #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)
.. want to adjust all of these, as they all have a similar issue.
And while doing such adjustments, please also add the missing blanks
around + .
However, these are macros used locally in a single .c file only, so
I'm not convinced as strict rules need to apply here. To make clear
no further uses (farther apart from the macro definitions) are
intended, an option would be to add #undef-s right after
cpu_bit_bitmap[]'s initializer. (But this is not an objection to
adding the parentheses, just a general remark.)
Jan