From: kernel test robot <lkp@intel.com>
To: Asad Kamal <asad.kamal@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Alex Deucher <alexander.deucher@amd.com>,
Lijo Lazar <lijo.lazar@amd.com>,
Yang Wang <kevinyang.wang@amd.com>
Subject: drivers/gpu/drm/amd/pm/amdgpu_pm.c:2248:32-38: opportunity for str_enabled_disabled(npower)
Date: Wed, 25 Mar 2026 14:33:23 +0800 [thread overview]
Message-ID: <202603251434.zIN2QYWn-lkp@intel.com> (raw)
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
reply other threads:[~2026-03-25 6:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202603251434.zIN2QYWn-lkp@intel.com \
--to=lkp@intel.com \
--cc=alexander.deucher@amd.com \
--cc=asad.kamal@amd.com \
--cc=kevinyang.wang@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®