lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202209261902.qJDWZGUZ-lkp@intel.com>
Date:   Tue, 27 Sep 2022 11:05:29 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Horatiu Vultur <horatiu.vultur@...rochip.com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [char-misc:char-misc-testing 29/36] drivers/nvmem/lan9662-otpc.c:43
 lan9662_otp_wait_flag_clear() warn: signedness bug returning '(-110)'

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@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...cle.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  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ