llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Phillip Potter <phil@philpotter.co.uk>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [staging:staging-testing 54/54] drivers/staging/r8188eu/core/rtw_pwrctrl.c:400:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Sat, 30 Jul 2022 16:14:57 +0800	[thread overview]
Message-ID: <202207301623.BfMKLfhv-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing
head:   f3a76018dd55d8ddcd28cb47049f46ae5c0ce557
commit: f3a76018dd55d8ddcd28cb47049f46ae5c0ce557 [54/54] staging: r8188eu: remove initializer from ret in rtw_pwr_wakeup
config: hexagon-randconfig-r015-20220729 (https://download.01.org/0day-ci/archive/20220730/202207301623.BfMKLfhv-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 52cd00cabf479aa7eb6dbb063b7ba41ea57bce9e)
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?id=f3a76018dd55d8ddcd28cb47049f46ae5c0ce557
        git remote add staging https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
        git fetch --no-tags staging staging-testing
        git checkout f3a76018dd55d8ddcd28cb47049f46ae5c0ce557
        # 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=hexagon SHELL=/bin/bash drivers/staging/r8188eu/

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

All warnings (new ones prefixed by >>):

>> drivers/staging/r8188eu/core/rtw_pwrctrl.c:400:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (padapter->bDriverStopped || !padapter->bup || !padapter->hw_init_completed) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/r8188eu/core/rtw_pwrctrl.c:409:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/staging/r8188eu/core/rtw_pwrctrl.c:400:2: note: remove the 'if' if its condition is always true
           if (padapter->bDriverStopped || !padapter->bup || !padapter->hw_init_completed) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/staging/r8188eu/core/rtw_pwrctrl.c:384:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +400 drivers/staging/r8188eu/core/rtw_pwrctrl.c

15865124feed88 Phillip Potter  2021-07-28  376  
57c27d38ff9379 Michael Straube 2022-04-03  377  /* Wake the NIC up from: 1)IPS 2)USB autosuspend */
719cf66c8a2b06 Michael Straube 2022-04-03  378  int rtw_pwr_wakeup(struct adapter *padapter)
15865124feed88 Phillip Potter  2021-07-28  379  {
15865124feed88 Phillip Potter  2021-07-28  380  	struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
15865124feed88 Phillip Potter  2021-07-28  381  	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
3b9d0da6aa08a3 Martin Kaiser   2022-04-13  382  	unsigned long timeout = jiffies + msecs_to_jiffies(3000);
1dd0ac70494c1d Martin Kaiser   2022-04-13  383  	unsigned long deny_time;
f3a76018dd55d8 Phillip Potter  2022-07-29  384  	int ret;
15865124feed88 Phillip Potter  2021-07-28  385  
3b9d0da6aa08a3 Martin Kaiser   2022-04-13  386  	while (pwrpriv->ps_processing && time_before(jiffies, timeout))
d21edee5a4276b Larry Finger    2021-08-05  387  		msleep(10);
15865124feed88 Phillip Potter  2021-07-28  388  
15865124feed88 Phillip Potter  2021-07-28  389  	/* I think this should be check in IPS, LPS, autosuspend functions... */
15865124feed88 Phillip Potter  2021-07-28  390  	if (check_fwstate(pmlmepriv, _FW_LINKED)) {
2b5002e2cc1483 Phillip Potter  2022-07-25  391  		ret = 0;
15865124feed88 Phillip Potter  2021-07-28  392  		goto exit;
15865124feed88 Phillip Potter  2021-07-28  393  	}
294e69c69c4d4a Martin Kaiser   2022-04-13  394  
294e69c69c4d4a Martin Kaiser   2022-04-13  395  	if (pwrpriv->rf_pwrstate == rf_off && ips_leave(padapter) == _FAIL) {
2b5002e2cc1483 Phillip Potter  2022-07-25  396  		ret = -ENOMEM;
15865124feed88 Phillip Potter  2021-07-28  397  		goto exit;
15865124feed88 Phillip Potter  2021-07-28  398  	}
15865124feed88 Phillip Potter  2021-07-28  399  
a9f136fa7e67fd Martin Kaiser   2022-04-13 @400  	if (padapter->bDriverStopped || !padapter->bup || !padapter->hw_init_completed) {
2b5002e2cc1483 Phillip Potter  2022-07-25  401  		ret = -EBUSY;
15865124feed88 Phillip Potter  2021-07-28  402  		goto exit;
15865124feed88 Phillip Potter  2021-07-28  403  	}
15865124feed88 Phillip Potter  2021-07-28  404  
15865124feed88 Phillip Potter  2021-07-28  405  exit:
1dd0ac70494c1d Martin Kaiser   2022-04-13  406  	deny_time = jiffies + msecs_to_jiffies(RTW_PWR_STATE_CHK_INTERVAL);
1dd0ac70494c1d Martin Kaiser   2022-04-13  407  	if (time_before(pwrpriv->ips_deny_time, deny_time))
1dd0ac70494c1d Martin Kaiser   2022-04-13  408  		pwrpriv->ips_deny_time = deny_time;
15865124feed88 Phillip Potter  2021-07-28  409  	return ret;
15865124feed88 Phillip Potter  2021-07-28  410  }
15865124feed88 Phillip Potter  2021-07-28  411  

:::::: The code at line 400 was first introduced by commit
:::::: a9f136fa7e67fdef97ad6c4be5f04f60ad78b5f3 staging: r8188eu: make return values consistent

:::::: TO: Martin Kaiser <martin@kaiser.cx>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

             reply	other threads:[~2022-07-30  8:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30  8:14 kernel test robot [this message]
2022-07-30 11:08 ` [staging:staging-testing 54/54] drivers/staging/r8188eu/core/rtw_pwrctrl.c:400:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false Greg Kroah-Hartman
2022-07-30 18:42   ` Phillip Potter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202207301623.BfMKLfhv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).