Skip to content

Commit 7a2df42

Browse files
rddunlapgregkh
authored andcommitted
hexagon: modify ffs() and fls() to return int
[ Upstream commit 5c41aaa ] 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@infradead.org> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: linux-hexagon@vger.kernel.org Cc: Geert Uytterhoeven <geert@linux-m68k.org> Patch-mainline: linux-kernel @ 07/22/2018, 16:03 Signed-off-by: Richard Kuo <rkuo@codeaurora.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2eb3072 commit 7a2df42

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/hexagon/include/asm/bitops.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static inline long ffz(int x)
211211
* This is defined the same way as ffs.
212212
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
213213
*/
214-
static inline long fls(int x)
214+
static inline int fls(int x)
215215
{
216216
int r;
217217

@@ -232,7 +232,7 @@ static inline long fls(int x)
232232
* the libc and compiler builtin ffs routines, therefore
233233
* differs in spirit from the above ffz (man ffs).
234234
*/
235-
static inline long ffs(int x)
235+
static inline int ffs(int x)
236236
{
237237
int r;
238238

0 commit comments

Comments
 (0)