[rafael-pm:bleeding-edge 5/6] drivers/base/power/runtime.c:1815:24: warning: increment of a boolean expression

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

 



Hi Rafael,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
head:   f890729ea3ca4d549b4e2414c42e932163814f09
commit: 5d872146e7f55e15c26d0a5600b155ee54bfdee6 [5/6] PM: sleep: Use bool for all 1-bit fields in struct dev_pm_info
config: i386-buildonly-randconfig-004-20240123 (https://download.01.org/0day-ci/archive/20240123/202401231130.9tnv8Gds-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240123/202401231130.9tnv8Gds-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401231130.9tnv8Gds-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/base/power/runtime.c: In function 'pm_runtime_new_link':
>> drivers/base/power/runtime.c:1815:24: warning: increment of a boolean expression [-Wbool-operation]
    1815 |  dev->power.links_count++;
         |                        ^~
   drivers/base/power/runtime.c: In function 'pm_runtime_drop_link_count':
>> drivers/base/power/runtime.c:1823:24: warning: decrement of a boolean expression [-Wbool-operation]
    1823 |  dev->power.links_count--;
         |                        ^~


vim +1815 drivers/base/power/runtime.c

21d5c57b3726166 Rafael J. Wysocki 2016-10-30  1811  
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1812  void pm_runtime_new_link(struct device *dev)
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1813  {
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1814  	spin_lock_irq(&dev->power.lock);
baa8809f60971d1 Rafael J. Wysocki 2016-10-30 @1815  	dev->power.links_count++;
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1816  	spin_unlock_irq(&dev->power.lock);
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1817  }
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1818  
e0e398e204634db Rafael J. Wysocki 2020-10-21  1819  static void pm_runtime_drop_link_count(struct device *dev)
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1820  {
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1821  	spin_lock_irq(&dev->power.lock);
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1822  	WARN_ON(dev->power.links_count == 0);
baa8809f60971d1 Rafael J. Wysocki 2016-10-30 @1823  	dev->power.links_count--;
baa8809f60971d1 Rafael J. Wysocki 2016-10-30  1824  	spin_unlock_irq(&dev->power.lock);
e0e398e204634db Rafael J. Wysocki 2020-10-21  1825  }
e0e398e204634db Rafael J. Wysocki 2020-10-21  1826  

:::::: The code at line 1815 was first introduced by commit
:::::: baa8809f60971d10220dfe79248f54b2b265f003 PM / runtime: Optimize the use of device links

:::::: TO: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[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