From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Asad Kamal <asad.kamal@amd.com>, amd-gfx@lists.freedesktop.org
Cc: hawking.zhang@amd.com, le.ma@amd.com, shiwu.zhang@amd.com,
alexander.deucher@amd.com, kevinyang.wang@amd.com,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] drm/amd/pm: Use str_enabled_disabled in amdgpu_pm sysfs
Date: Wed, 25 Mar 2026 15:39:52 +0530 [thread overview]
Message-ID: <1dd19c31-66fe-4a77-bdcc-2bfce4ccf36a@amd.com> (raw)
In-Reply-To: <20260325095813.3374163-1-asad.kamal@amd.com>
On 25-Mar-26 3:28 PM, Asad Kamal wrote:
> Coccinelle flags hand-rolled "enabled"/"disabled" strings; use the shared
> str_enabled_disabled() helper from string_choices.h for npm_status and
> thermal throttling logging sysfs text.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202603251434.zIN2QYWn-lkp@intel.com/
>
> Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index 6565cc3e35f2..a4d8e667eafb 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -33,6 +33,7 @@
> #include <linux/hwmon-sysfs.h>
> #include <linux/nospec.h>
> #include <linux/pm_runtime.h>
> +#include <linux/string_choices.h>
> #include <asm/processor.h>
>
> #define MAX_NUM_OF_FEATURES_PER_SUBSET 8
> @@ -1592,7 +1593,7 @@ static ssize_t amdgpu_get_thermal_throttling_logging(struct device *dev,
>
> return sysfs_emit(buf, "%s: thermal throttling logging %s, with interval %d seconds\n",
> adev_to_drm(adev)->unique,
> - atomic_read(&adev->throttling_logging_enabled) ? "enabled" : "disabled",
> + str_enabled_disabled(atomic_read(&adev->throttling_logging_enabled)),
> adev->throttling_logging_rs.interval / HZ + 1);
> }
>
> @@ -2235,7 +2236,7 @@ static ssize_t amdgpu_show_npm_status(struct device *dev,
> if (r)
> return r;
>
> - return sysfs_emit(buf, "%s\n", npower ? "enabled" : "disabled");
> + return sysfs_emit(buf, "%s\n", str_enabled_disabled(npower));
> }
>
> /**
prev parent reply other threads:[~2026-03-25 10:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 9:58 [PATCH] drm/amd/pm: Use str_enabled_disabled in amdgpu_pm sysfs Asad Kamal
2026-03-25 10:09 ` Lazar, Lijo [this message]
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=1dd19c31-66fe-4a77-bdcc-2bfce4ccf36a@amd.com \
--to=lijo.lazar@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=asad.kamal@amd.com \
--cc=hawking.zhang@amd.com \
--cc=kevinyang.wang@amd.com \
--cc=le.ma@amd.com \
--cc=lkp@intel.com \
--cc=shiwu.zhang@amd.com \
/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