From: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Hans de Goede <hansg@kernel.org>,
platform-driver-x86@vger.kernel.org, mario.limonciello@amd.com,
Sanket.Goswami@amd.com
Subject: Re: [PATCH v5 5/8] platform/x86/amd/pmf: Move debug helper functions to UAPI header
Date: Wed, 27 May 2026 15:07:49 +0530 [thread overview]
Message-ID: <fc9458c0-b6d3-4f2c-bb57-7b33e578e3e3@amd.com> (raw)
In-Reply-To: <393119ac-3a30-9baa-da10-a123969b4c96@linux.intel.com>
On 5/21/2026 16:32, Ilpo Järvinen wrote:
> On Thu, 21 May 2026, Shyam Sundar S K wrote:
>
>> These debug helper functions convert enumerated values to appropriate
>> message and can be useful for userspace tools and other kernel components
>> that need to interpret AMD PMF state values.
>>
>> By making them inline functions in the UAPI header, they become available
>> to both kernel and userspace without code duplication. Also, prefix the
>> function names with amd_pmf_.
>>
>> Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com>
>> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
>> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
>> ---
>> drivers/platform/x86/amd/pmf/spc.c | 61 ++----------------------------
>> include/uapi/linux/amd-pmf.h | 57 ++++++++++++++++++++++++++++
>> 2 files changed, 60 insertions(+), 58 deletions(-)
>
>
>> diff --git a/include/uapi/linux/amd-pmf.h b/include/uapi/linux/amd-pmf.h
>> index 54baf015e4c1..a8c715bee9cc 100644
>> --- a/include/uapi/linux/amd-pmf.h
>> +++ b/include/uapi/linux/amd-pmf.h
>> @@ -115,6 +115,63 @@ enum amd_pmf_platform_type {
>> AMD_PMF_PTYPE_INVALID = 0xf,
>> };
>>
>> +/* Retrieve the platform type as a string */
>> +static inline const char *amd_pmf_get_pt(unsigned int platform_type)
>
>> +/* Retrieve the laptop placement as a string */
>> +static inline const char *amd_pmf_get_lp(unsigned int device_state)
>
>> +/* Retrieve the slider position as a string */
>> +static inline const char *amd_pmf_get_sp(unsigned int state)
>
> "pt", "lp", and "sp" are not particularly descriptive. I know they get a
> bit longer if you expand them but it'd be huge win for code readability
> still.
>
Ack to all the comments for patches from 1 to 5. Specific to this
feedback, I thought instead of having long names thought to shorten it
as "pt", "lp" etc along with a comment to say what that function does.
But, yeah; I get your point. Shall change it to longer names in v6.
Thanks,
Shyam
next prev parent reply other threads:[~2026-05-27 9:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 18:54 [PATCH v5 0/8] platform/x86/amd/pmf: Introduce PMF util layer with userspace interface Shyam Sundar S K
2026-05-20 18:54 ` [PATCH v5 1/8] platform/x86/amd/pmf: Add util layer and userspace character device interface Shyam Sundar S K
2026-05-22 13:21 ` Ilpo Järvinen
2026-05-20 18:54 ` [PATCH v5 2/8] platform/x86/amd/pmf: store BIOS output values for user-space metrics via util IOCTL Shyam Sundar S K
2026-05-22 13:28 ` Ilpo Järvinen
2026-05-20 18:54 ` [PATCH v5 3/8] platform/x86/amd/pmf: Add feature discovery support to util interface Shyam Sundar S K
2026-05-22 13:29 ` Ilpo Järvinen
2026-05-20 18:54 ` [PATCH v5 4/8] platform/x86/amd/pmf: Store commonly used enums in the header file Shyam Sundar S K
2026-05-22 13:31 ` Ilpo Järvinen
2026-05-20 18:54 ` [PATCH v5 5/8] platform/x86/amd/pmf: Move debug helper functions to UAPI header Shyam Sundar S K
2026-05-21 11:02 ` Ilpo Järvinen
2026-05-27 9:37 ` Shyam Sundar S K [this message]
2026-05-22 13:35 ` Ilpo Järvinen
2026-05-20 18:54 ` [PATCH v5 6/8] platform/x86/amd/pmf: Implement util layer ioctl handler Shyam Sundar S K
2026-05-21 10:58 ` Ilpo Järvinen
2026-05-27 10:15 ` Shyam Sundar S K
2026-05-27 11:09 ` Ilpo Järvinen
2026-05-22 13:44 ` Ilpo Järvinen
2026-05-20 18:54 ` [PATCH v5 7/8] platform/x86/amd/pmf: Introduce AMD PMF testing tool for driver metrics and features Shyam Sundar S K
2026-05-20 18:54 ` [PATCH v5 8/8] Documentation/ABI: add testing entry for AMD PMF character device interface Shyam Sundar S K
2026-05-21 11:07 ` Ilpo Järvinen
2026-05-27 9:35 ` Shyam Sundar S K
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=fc9458c0-b6d3-4f2c-bb57-7b33e578e3e3@amd.com \
--to=shyam-sundar.s-k@amd.com \
--cc=Sanket.Goswami@amd.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=mario.limonciello@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
/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