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>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 23 Apr 2022 02:16:08 +0800
From:   kernel test robot <lkp@...el.com>
To:     Cixi Geng <gengcixi@...il.com>, sre@...nel.org,
        orsonzhai@...il.com, baolin.wang7@...il.com, zhang.lyra@...il.com,
        chenyongzhi811@...il.com
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] power: supply: Add enable the primary charger interface

Hi Cixi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on v5.18-rc3 next-20220422]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Cixi-Geng/power-supply-Add-enable-the-primary-charger-interface/20220422-154432
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: riscv-randconfig-r042-20220422 (https://download.01.org/0day-ci/archive/20220423/202204230206.9TgyhSb1-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/a566cf23ffad8453d1e1f611086b6eda3f14515d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Cixi-Geng/power-supply-Add-enable-the-primary-charger-interface/20220422-154432
        git checkout a566cf23ffad8453d1e1f611086b6eda3f14515d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/power/supply/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/power/supply/sc2731_charger.c:156:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           } else if (val && !info->charging) {
                      ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/sc2731_charger.c:164:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/power/supply/sc2731_charger.c:156:9: note: remove the 'if' if its condition is always true
           } else if (val && !info->charging) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/power/supply/sc2731_charger.c:156:13: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
           } else if (val && !info->charging) {
                      ^~~
   drivers/power/supply/sc2731_charger.c:164:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/power/supply/sc2731_charger.c:156:13: note: remove the '&&' if its condition is always true
           } else if (val && !info->charging) {
                      ^~~~~~
>> drivers/power/supply/sc2731_charger.c:153:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!val && info->charging) {
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/sc2731_charger.c:164:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/power/supply/sc2731_charger.c:153:2: note: remove the 'if' if its condition is always false
           if (!val && info->charging) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/sc2731_charger.c:151:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   drivers/power/supply/sc2731_charger.c:255:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   if (val->intval == true) {
                       ^~~~~~~~~~~~~~~~~~~
   drivers/power/supply/sc2731_charger.c:268:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/power/supply/sc2731_charger.c:255:3: note: remove the 'if' if its condition is always true
                   if (val->intval == true) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/sc2731_charger.c:225:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   4 warnings generated.


vim +156 drivers/power/supply/sc2731_charger.c

   148	
   149	static int sc2731_charger_set_status(struct sc2731_charger_info *info, int val)
   150	{
   151		int ret;
   152	
 > 153		if (!val && info->charging) {
   154			sc2731_charger_stop_charge(info);
   155			info->charging = false;
 > 156		} else if (val && !info->charging) {
   157			ret = sc2731_charger_start_charge(info);
   158			if (ret)
   159				dev_err(info->dev, "start charge failed\n");
   160			else
   161				info->charging = true;
   162		}
   163	
   164		return ret;
   165	}
   166	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ