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 <stefano.stabell...@amd.com> --- diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h index 9826707909..a6ed6a28e8 100644 --- a/xen/include/xen/cpumask.h +++ b/xen/include/xen/cpumask.h @@ -208,7 +208,7 @@ static inline void cpumask_copy(cpumask_t *dstp, const cpumask_t *srcp) static inline int cpumask_first(const cpumask_t *srcp) { - return min_t(int, nr_cpu_ids, find_first_bit(srcp->bits, nr_cpu_ids)); + return min_t(unsigned long, nr_cpu_ids, find_first_bit(srcp->bits, nr_cpu_ids)); } static inline int cpumask_next(int n, const cpumask_t *srcp)