]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.132/hexagon-modify-ffs-and-fls-to-return-int.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.9.132 / hexagon-modify-ffs-and-fls-to-return-int.patch
1 From foo@baz Mon Oct 8 18:01:43 CEST 2018
2 From: Randy Dunlap <rdunlap@infradead.org>
3 Date: Sun, 22 Jul 2018 16:03:58 -0700
4 Subject: hexagon: modify ffs() and fls() to return int
5
6 From: Randy Dunlap <rdunlap@infradead.org>
7
8 [ Upstream commit 5c41aaad409c097cf1ef74f2c649fed994744ef5 ]
9
10 Building drivers/mtd/nand/raw/nandsim.c on arch/hexagon/ produces a
11 printk format build warning. This is due to hexagon's ffs() being
12 coded as returning long instead of int.
13
14 Fix the printk format warning by changing all of hexagon's ffs() and
15 fls() functions to return int instead of long. The variables that
16 they return are already int instead of long. This return type
17 matches the return type in <asm-generic/bitops/>.
18
19 ../drivers/mtd/nand/raw/nandsim.c: In function 'init_nandsim':
20 ../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]
21
22 There are no ffs() or fls() allmodconfig build errors after making this
23 change.
24
25 Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
26 Cc: Richard Kuo <rkuo@codeaurora.org>
27 Cc: linux-hexagon@vger.kernel.org
28 Cc: Geert Uytterhoeven <geert@linux-m68k.org>
29 Patch-mainline: linux-kernel @ 07/22/2018, 16:03
30 Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
31 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
32 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33 ---
34 arch/hexagon/include/asm/bitops.h | 4 ++--
35 1 file changed, 2 insertions(+), 2 deletions(-)
36
37 --- a/arch/hexagon/include/asm/bitops.h
38 +++ b/arch/hexagon/include/asm/bitops.h
39 @@ -211,7 +211,7 @@ static inline long ffz(int x)
40 * This is defined the same way as ffs.
41 * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
42 */
43 -static inline long fls(int x)
44 +static inline int fls(int x)
45 {
46 int r;
47
48 @@ -232,7 +232,7 @@ static inline long fls(int x)
49 * the libc and compiler builtin ffs routines, therefore
50 * differs in spirit from the above ffz (man ffs).
51 */
52 -static inline long ffs(int x)
53 +static inline int ffs(int x)
54 {
55 int r;
56