Re: [PATCH v2] hexagon: modify ffs() and fls() to return int

From: Geert Uytterhoeven
Date: Mon Jul 23 2018 - 03:58:49 EST


On Mon, Jul 23, 2018 at 1:04 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
> From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
>
> Building drivers/mtd/nand/raw/nandsim.c on arch/hexagon/ produces a
> printk format build warning. This is due to hexagon's ffs() being
> coded as returning long instead of int.
>
> Fix the printk format warning by changing all of hexagon's ffs() and
> fls() functions to return int instead of long. The variables that
> they return are already int instead of long. This return type
> matches the return type in <asm-generic/bitops/>.
>
> ../drivers/mtd/nand/raw/nandsim.c: In function 'init_nandsim':
> ../drivers/mtd/nand/raw/nandsim.c:760:2: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'long int' [-Wformat]
>
> There are no ffs() or fls() allmodconfig build errors after making this
> change.
>
> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> Cc: Richard Kuo <rkuo@xxxxxxxxxxxxxx>
> Cc: linux-hexagon@xxxxxxxxxxxxxxx
> Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

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