mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [char-misc:char-misc-testing 29/36] drivers/nvmem/lan9662-otpc.c:43 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)'
@ 2022-09-27  8:05 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-09-27  8:05 UTC (permalink / raw)
  To: kbuild, Horatiu Vultur
  Cc: lkp, kbuild-all, linux-kernel, Greg Kroah-Hartman, Srinivas Kandagatla

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing
head:   0f65caa911019561d71ceb70f0d1c7a965b3045f
commit: 9e8f208ad5229ddda97cd4a83ecf89c735d99592 [29/36] nvmem: lan9662-otp: add support
config: openrisc-randconfig-m041-20220926
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/nvmem/lan9662-otpc.c:43 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)'

vim +43 drivers/nvmem/lan9662-otpc.c

9e8f208ad5229d Horatiu Vultur 2022-09-16  39  static bool lan9662_otp_wait_flag_clear(void __iomem *reg, u32 flag)
9e8f208ad5229d Horatiu Vultur 2022-09-16  40  {
9e8f208ad5229d Horatiu Vultur 2022-09-16  41  	u32 val;
9e8f208ad5229d Horatiu Vultur 2022-09-16  42  
9e8f208ad5229d Horatiu Vultur 2022-09-16 @43  	return readl_poll_timeout(reg, val, !(val & flag),
9e8f208ad5229d Horatiu Vultur 2022-09-16  44  				  OTP_SLEEP_US, OTP_TIMEOUT_US);


readl_poll_timeout() returns zero on success or a negative error code.
Better to make lan9662_otp_wait_flag_clear() return ints.  Returning
false/true (as opposed to true/false or zero/negative) for
success/failure is pants.

9e8f208ad5229d Horatiu Vultur 2022-09-16  45  }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-27  8:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27  8:05 [char-misc:char-misc-testing 29/36] drivers/nvmem/lan9662-otpc.c:43 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)' Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®