[pm:pm-sleep-core 2/3] drivers/base/power/main.c:824:10: warning: 'callback' may be used uninitialized in this function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git pm-sleep-core
head:   a52086e57479bf4eb7e328aefc491dcb0c2da475
commit: bc95fd57b878a950c92e57ce8e2bd9d33a40d0cf [2/3] PM: sleep: core: Fold functions into their callers
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout bc95fd57b878a950c92e57ce8e2bd9d33a40d0cf
        # save the attached .config to linux build tree
        GCC_VERSION=9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/base/power/main.c:568:21: warning: 'suspend_event' defined but not used [-Wunused-function]
     568 | static pm_message_t suspend_event(pm_message_t resume_msg)
         |                     ^~~~~~~~~~~~~
   drivers/base/power/main.c: In function 'device_resume_early':
   drivers/base/power/main.c:824:10: warning: 'info' may be used uninitialized in this function [-Wmaybe-uninitialized]
     824 |  error = dpm_run_callback(callback, dev, state, info);
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/base/power/main.c:824:10: warning: 'callback' may be used uninitialized in this function [-Wmaybe-uninitialized]
   drivers/base/power/main.c: In function 'device_resume_noirq':
   drivers/base/power/main.c:664:10: warning: 'info' may be used uninitialized in this function [-Wmaybe-uninitialized]
     664 |  error = dpm_run_callback(callback, dev, state, info);
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/main.c: In function '__device_suspend_noirq':
   drivers/base/power/main.c:1248:10: warning: 'info' may be used uninitialized in this function [-Wmaybe-uninitialized]
    1248 |  error = dpm_run_callback(callback, dev, state, info);
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/main.c: In function '__device_suspend_late':
   drivers/base/power/main.c:1449:10: warning: 'info' may be used uninitialized in this function [-Wmaybe-uninitialized]
    1449 |  error = dpm_run_callback(callback, dev, state, info);
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/callback +824 drivers/base/power/main.c

cf579dfb82550e Rafael J. Wysocki 2012-01-29  780  
cf579dfb82550e Rafael J. Wysocki 2012-01-29  781  /**
cf579dfb82550e Rafael J. Wysocki 2012-01-29  782   * device_resume_early - Execute an "early resume" callback for given device.
cf579dfb82550e Rafael J. Wysocki 2012-01-29  783   * @dev: Device to handle.
cf579dfb82550e Rafael J. Wysocki 2012-01-29  784   * @state: PM transition of the system being carried out.
58c256a3a37ea7 Randy Dunlap      2014-07-27  785   * @async: If true, the device is being resumed asynchronously.
cf579dfb82550e Rafael J. Wysocki 2012-01-29  786   *
cf579dfb82550e Rafael J. Wysocki 2012-01-29  787   * Runtime PM is disabled for @dev while this function is being executed.
cf579dfb82550e Rafael J. Wysocki 2012-01-29  788   */
9e5e7910df824b Liu, Chuansheng   2014-02-18  789  static int device_resume_early(struct device *dev, pm_message_t state, bool async)
cf579dfb82550e Rafael J. Wysocki 2012-01-29  790  {
4fa3061a6856cc Rafael J. Wysocki 2017-12-10  791  	pm_callback_t callback;
4fa3061a6856cc Rafael J. Wysocki 2017-12-10  792  	const char *info;
cf579dfb82550e Rafael J. Wysocki 2012-01-29  793  	int error = 0;
cf579dfb82550e Rafael J. Wysocki 2012-01-29  794  
cf579dfb82550e Rafael J. Wysocki 2012-01-29  795  	TRACE_DEVICE(dev);
cf579dfb82550e Rafael J. Wysocki 2012-01-29  796  	TRACE_RESUME(0);
cf579dfb82550e Rafael J. Wysocki 2012-01-29  797  
aae4518b3124b2 Rafael J. Wysocki 2014-05-16  798  	if (dev->power.syscore || dev->power.direct_complete)
dbf374142dd7a3 Rafael J. Wysocki 2012-08-06  799  		goto Out;
dbf374142dd7a3 Rafael J. Wysocki 2012-08-06  800  
3d2699bc179a10 Liu, Chuansheng   2014-02-18  801  	if (!dev->power.is_late_suspended)
3d2699bc179a10 Liu, Chuansheng   2014-02-18  802  		goto Out;
3d2699bc179a10 Liu, Chuansheng   2014-02-18  803  
0552e05fdfea19 Rafael J. Wysocki 2020-01-23  804  	if (!dpm_wait_for_superior(dev, async))
0552e05fdfea19 Rafael J. Wysocki 2020-01-23  805  		goto Out;
9e5e7910df824b Liu, Chuansheng   2014-02-18  806  
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  807  	if (dev->pm_domain) {
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  808  		info = "early power domain ";
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  809  		callback = pm_late_early_op(&dev->pm_domain->ops, state);
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  810  	} else if (dev->type && dev->type->pm) {
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  811  		info = "early type ";
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  812  		callback = pm_late_early_op(dev->type->pm, state);
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  813  	} else if (dev->class && dev->class->pm) {
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  814  		info = "early class ";
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  815  		callback = pm_late_early_op(dev->class->pm, state);
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  816  	} else if (dev->bus && dev->bus->pm) {
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  817  		info = "early bus ";
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  818  		callback = pm_late_early_op(dev->bus->pm, state);
bc95fd57b878a9 Rafael J. Wysocki 2020-04-04  819  	} else if (dev->driver && dev->driver->pm) {
cf579dfb82550e Rafael J. Wysocki 2012-01-29  820  		info = "early driver ";
cf579dfb82550e Rafael J. Wysocki 2012-01-29  821  		callback = pm_late_early_op(dev->driver->pm, state);
cf579dfb82550e Rafael J. Wysocki 2012-01-29  822  	}
cf579dfb82550e Rafael J. Wysocki 2012-01-29  823  
cf579dfb82550e Rafael J. Wysocki 2012-01-29 @824  	error = dpm_run_callback(callback, dev, state, info);
3d2699bc179a10 Liu, Chuansheng   2014-02-18  825  	dev->power.is_late_suspended = false;
cf579dfb82550e Rafael J. Wysocki 2012-01-29  826  
dbf374142dd7a3 Rafael J. Wysocki 2012-08-06  827   Out:
cf579dfb82550e Rafael J. Wysocki 2012-01-29  828  	TRACE_RESUME(error);
9f6d8f6ab26b42 Rafael J. Wysocki 2012-12-22  829  
9f6d8f6ab26b42 Rafael J. Wysocki 2012-12-22  830  	pm_runtime_enable(dev);
9e5e7910df824b Liu, Chuansheng   2014-02-18  831  	complete_all(&dev->power.completion);
cf579dfb82550e Rafael J. Wysocki 2012-01-29  832  	return error;
cf579dfb82550e Rafael J. Wysocki 2012-01-29  833  }
cf579dfb82550e Rafael J. Wysocki 2012-01-29  834  

:::::: The code at line 824 was first introduced by commit
:::::: cf579dfb82550e34de7ccf3ef090d8b834ccd3a9 PM / Sleep: Introduce "late suspend" and "early resume" of devices

:::::: TO: Rafael J. Wysocki <rjw@xxxxxxx>
:::::: CC: Rafael J. Wysocki <rjw@xxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux