[rafael-pm:fixes 3/5] drivers/powercap/intel_rapl_common.c:357:50-54: opportunity for str_enabled_disabled(mode)

[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 fixes
head:   e962f723d1420ff8ac720a80fa2b65abc7ece1ff
commit: 3b2cebf28cac6dc375be5be675dd767b400cd294 [3/5] powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed
config: x86_64-randconfig-104-20250629 (https://download.01.org/0day-ci/archive/20250629/202506290745.i7nfrR7D-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)

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/202506290745.i7nfrR7D-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> drivers/powercap/intel_rapl_common.c:357:50-54: opportunity for str_enabled_disabled(mode)

vim +357 drivers/powercap/intel_rapl_common.c

   339	
   340	static int set_domain_enable(struct powercap_zone *power_zone, bool mode)
   341	{
   342		struct rapl_domain *rd = power_zone_to_rapl_domain(power_zone);
   343		struct rapl_defaults *defaults = get_defaults(rd->rp);
   344		u64 val;
   345		int ret;
   346	
   347		cpus_read_lock();
   348		ret = rapl_write_pl_data(rd, POWER_LIMIT1, PL_ENABLE, mode);
   349		if (ret)
   350			goto end;
   351	
   352		ret = rapl_read_pl_data(rd, POWER_LIMIT1, PL_ENABLE, false, &val);
   353		if (ret)
   354			goto end;
   355	
   356		if (mode != val) {
 > 357			pr_debug("%s cannot be %s\n", power_zone->name, mode ? "enabled" : "disabled");
   358			goto end;
   359		}
   360	
   361		if (defaults->set_floor_freq)
   362			defaults->set_floor_freq(rd, mode);
   363	
   364	end:
   365		cpus_read_unlock();
   366	
   367		return ret;
   368	}
   369	

-- 
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