On 04.09.2023 11:14, Michal Orzel wrote:
> --- a/xen/include/xen/bitops.h
> +++ b/xen/include/xen/bitops.h
> @@ -51,7 +51,7 @@ static inline int generic_ffs(int x)
>   * fls: find last bit set.
>   */
>  
> -static __inline__ int generic_fls(int x)
> +static __inline__ int generic_fls(unsigned int x)
>  {
>      int r = 32;
>  

Even if perhaps not affected by UBSAN, generic_ffs() then wants taking care
of as well, imo. If additionally you switch __inline__ to inline, things
will become nicely symmetric with generic_f{f,l}sl().

Another aspect that may be nice to take care of at this occasion is their
return values: None of them can return negative values, so return type
would better be unsigned int.

Jan

Reply via email to