0c842f0793219bfa8376f85ffe9feb3244ed2ba7
[openwrt/staging/ldir.git] /
1 From 022b68f271de0e53024e6d5e96fee8e76d25eb95 Mon Sep 17 00:00:00 2001
2 From: Horatiu Vultur <horatiu.vultur@microchip.com>
3 Date: Fri, 18 Nov 2022 06:38:40 +0000
4 Subject: [PATCH] nvmem: lan9662-otp: Change return type of
5 lan9662_otp_wait_flag_clear()
6
7 The blamed commit introduced the following smatch warning in the
8 function lan9662_otp_wait_flag_clear:
9 drivers/nvmem/lan9662-otpc.c:43 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)'
10
11 Fix this by changing the return type of the function
12 lan9662_otp_wait_flag_clear() to be int instead of bool.
13
14 Fixes: 9e8f208ad5229d ("nvmem: lan9662-otp: add support")
15 Reported-by: kernel test robot <lkp@intel.com>
16 Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
17 Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
18 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
19 Link: https://lore.kernel.org/r/20221118063840.6357-5-srinivas.kandagatla@linaro.org
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 ---
22 drivers/nvmem/lan9662-otpc.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25 --- a/drivers/nvmem/lan9662-otpc.c
26 +++ b/drivers/nvmem/lan9662-otpc.c
27 @@ -36,7 +36,7 @@ struct lan9662_otp {
28 void __iomem *base;
29 };
30
31 -static bool lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
32 +static int lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
33 {
34 u32 val;
35