Re: [PATCH] fls: Change parameter to unsigned int

From: Geert Uytterhoeven
Date: Tue Nov 06 2018 - 03:15:00 EST


On Mon, Nov 5, 2018 at 11:11 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> When testing in userspace, UBSAN pointed out that shifting into the sign
> bit is undefined behaviour. It doesn't really make sense to ask for the
> highest set bit of a negative value, so just turn the argument type into
> an unsigned int.
>
> Some architectures (eg ppc) already had it declared as an unsigned int,
> so I don't expect too many problems.
>
> Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>

Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds