Re: [PATCH] cpumask: fix integer type in cpumask_first

2023-09-29 Thread Stefano Stabellini
On Fri, 29 Sep 2023, Luca Fancellu wrote: > > On 29 Sep 2023, at 08:31, Julien Grall wrote: > > > > Hi Stefano, > > > > On 29/09/2023 00:32, Stefano Stabellini wrote: > >> nr_cpu_ids is unsigned int, but find_first_bit returns unsigned long (at > >> least on arm). > > > > find_* are meant to be

Re: [PATCH] cpumask: fix integer type in cpumask_first

2023-09-29 Thread Luca Fancellu
> On 29 Sep 2023, at 08:31, Julien Grall wrote: > > Hi Stefano, > > On 29/09/2023 00:32, Stefano Stabellini wrote: >> nr_cpu_ids is unsigned int, but find_first_bit returns unsigned long (at >> least on arm). > > find_* are meant to be used by common code. So I think the first step is to > c

Re: [PATCH] cpumask: fix integer type in cpumask_first

2023-09-29 Thread Julien Grall
Hi Stefano, On 29/09/2023 00:32, Stefano Stabellini wrote: nr_cpu_ids is unsigned int, but find_first_bit returns unsigned long (at least on arm). find_* are meant to be used by common code. So I think the first step is to correct the return type so it is consistent across all architectures.

[PATCH] cpumask: fix integer type in cpumask_first

2023-09-28 Thread Stefano Stabellini
nr_cpu_ids is unsigned int, but find_first_bit returns unsigned long (at least on arm). Use the larger type for min_t to avoid larger-to-smaller type assignments. This address 141 MISRA C 10.3 violations. Signed-off-by: Stefano Stabellini --- diff --git a/xen/include/xen/cpumask.h b/xen/include/