Skip to contentSkip to conversation

nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear()

PATCH In review Horatiu Vultur 2 participants 2 messages Sep 27, 2022 – Nov 11, 2022 NVMEM framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear()

The blamed commit introduced the following smatch warning in the
function lan9662_otp_wait_flag_clear:
drivers/nvmem/lan9662-otpc.c:43 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)'

Fix this by changing the return type of the function lan9662_otp_wait_flag_clear() to be int instead of bool.

Fixes 9e8f208ad5229d ("nvmem: lan9662-otp: add support")
---
 drivers/nvmem/lan9662-otpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/lan9662-otpc.c +1 -1
index f6732fd216d80..f4348c97f6e59 100644
@@ -36,7 +36,7 @@ struct lan9662_otp {
 	void __iomem *base;
 };
 
-static bool lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
+static int lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
 {
 	u32 val;
 
Signature · 1 line
2.33.0
#1 lore raw
Quoted 4 lines · Horatiu Vultur

The blamed commit introduced the following smatch warning in the
function lan9662_otp_wait_flag_clear:
drivers/nvmem/lan9662-otpc.c:43 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)'

Quoted 8 lines

Fix this by changing the return type of the function lan9662_otp_wait_flag_clear() to be int instead of bool.

Fixes 9e8f208ad5229d ("nvmem: lan9662-otp: add support")

---

Applied thanks,
--srini

Quoted 16 lines
  drivers/nvmem/lan9662-otpc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/lan9662-otpc.c +1 -1
index f6732fd216d80..f4348c97f6e59 100644
@@ -36,7 +36,7 @@ struct lan9662_otp {
  	void __iomem *base;
  };
 
-static bool lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
+static int lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
  {
  	u32 val;