mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/pm/amdgpu_pm.c:2248:32-38: opportunity for str_enabled_disabled(npower)
@ 2026-03-25  6:33 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-25  6:33 UTC (permalink / raw)
  To: Asad Kamal
  Cc: oe-kbuild-all, linux-kernel, Alex Deucher, Lijo Lazar, Yang Wang

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   bbeb83d3182abe0d245318e274e8531e5dd7a948
commit: ef612f58d944ce4a468fa533335035a6e5163eda drm/amd/pm: Add sysfs node for node power
date:   6 months ago
config: s390-randconfig-r052-20260323 (https://download.01.org/0day-ci/archive/20260325/202603251434.zIN2QYWn-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project c911b8492374942bf4cfe35411e90a35d3837f6a)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603251434.zIN2QYWn-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/pm/amdgpu_pm.c:2248:32-38: opportunity for str_enabled_disabled(npower)
   drivers/gpu/drm/amd/pm/amdgpu_pm.c:1600:5-51: opportunity for str_enabled_disabled(atomic_read ( & adev -> throttling_logging_enabled ))

vim +2248 drivers/gpu/drm/amd/pm/amdgpu_pm.c

  2226	
  2227	/**
  2228	 * DOC: npm_status
  2229	 *
  2230	 * The amdgpu driver provides a sysfs API for retrieving current node power management status.
  2231	 * The file npm_status is used for this. It shows the status as enabled or disabled based on
  2232	 * current node power value. If node power is zero, status is disabled else enabled.
  2233	 */
  2234	static ssize_t amdgpu_show_npm_status(struct device *dev,
  2235					      struct device_attribute *attr, char *buf)
  2236	{
  2237		struct drm_device *ddev = dev_get_drvdata(dev);
  2238		struct amdgpu_device *adev = drm_to_adev(ddev);
  2239		u32 npower;
  2240		int r;
  2241	
  2242		/* get the node power */
  2243		r = amdgpu_pm_get_sensor_generic(adev, AMDGPU_PP_SENSOR_NODEPOWER,
  2244						 (void *)&npower);
  2245		if (r)
  2246			return r;
  2247	
> 2248		return sysfs_emit(buf, "%s\n", npower ? "enabled" : "disabled");
  2249	}
  2250	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-25  6:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-25  6:33 drivers/gpu/drm/amd/pm/amdgpu_pm.c:2248:32-38: opportunity for str_enabled_disabled(npower) kernel test robot

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

all inboxes | Powered by JetHome®