linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 2881/4780] drivers/bus/ti-sysc.c:1398:13: warning: variable 'error' is used uninitialized whenever 'if' condition is false
@ 2021-05-24  9:59 kernel test robot
  2021-05-25  5:39 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-05-24  9:59 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: kbuild-all, clang-built-linux, Linux Memory Management List

[-- Attachment #1: Type: text/plain, Size: 2971 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   674dc447b09fb668976c6ab1356b11e02ff209ed
commit: ec527f23e06a0521cd5b043aa31a4ccdf6cea549 [2881/4780] bus: ti-sysc: Fix am335x resume hang for usb otg module
config: arm-randconfig-r035-20210524 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 93d1e5822ed64abd777eb94ea9899e96c4c39fbe)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ec527f23e06a0521cd5b043aa31a4ccdf6cea549
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout ec527f23e06a0521cd5b043aa31a4ccdf6cea549
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

>> drivers/bus/ti-sysc.c:1398:13: warning: variable 'error' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           } else if (ddata->needs_resume) {
                      ^~~~~~~~~~~~~~~~~~~
   drivers/bus/ti-sysc.c:1406:9: note: uninitialized use occurs here
           return error;
                  ^~~~~
   drivers/bus/ti-sysc.c:1398:9: note: remove the 'if' if its condition is always true
           } else if (ddata->needs_resume) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/ti-sysc.c:1386:11: note: initialize the variable 'error' to silence this warning
           int error;
                    ^
                     = 0
   1 warning generated.


vim +1398 drivers/bus/ti-sysc.c

  1382	
  1383	static int __maybe_unused sysc_noirq_resume(struct device *dev)
  1384	{
  1385		struct sysc *ddata;
  1386		int error;
  1387	
  1388		ddata = dev_get_drvdata(dev);
  1389	
  1390		if (ddata->cfg.quirks &
  1391		    (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE))
  1392			return 0;
  1393	
  1394		if (ddata->cfg.quirks & SYSC_QUIRK_REINIT_ON_RESUME) {
  1395			error = sysc_reinit_module(ddata, ddata->needs_resume);
  1396			if (error)
  1397				dev_warn(dev, "noirq_resume failed: %i\n", error);
> 1398		} else if (ddata->needs_resume) {
  1399			error = sysc_runtime_resume(dev);
  1400			if (error)
  1401				dev_warn(dev, "noirq_resume failed: %i\n", error);
  1402		}
  1403	
  1404		ddata->needs_resume = 0;
  1405	
  1406		return error;
  1407	}
  1408	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33491 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-25  5:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24  9:59 [linux-next:master 2881/4780] drivers/bus/ti-sysc.c:1398:13: warning: variable 'error' is used uninitialized whenever 'if' condition is false kernel test robot
2021-05-25  5:39 ` Tony Lindgren
2021-05-25  5:47   ` Tony Lindgren
2021-05-25  5:51     ` Tony Lindgren

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