From: Mario Limonciello <superm1@kernel.org>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org, Patil.Reddy@amd.com,
Yijun.Shen@Dell.com
Subject: Re: [PATCH v2 1/2] platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
Date: Wed, 15 Oct 2025 09:59:33 -0500 [thread overview]
Message-ID: <1f69a884-fee5-434e-8d65-89bbc721276b@kernel.org> (raw)
In-Reply-To: <20251015145457.3231583-1-Shyam-sundar.S-k@amd.com>
On 10/15/25 9:54 AM, Shyam Sundar S K wrote:
> Define a new macro BIOS_INPUTS_MAX, to represent the maximum number of
> BIOS input values. Replace hardcoded array sizes in relevant structures
> with this macro to improve readability and maintainability.
>
> Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> v2:
> - New patch spinned from v1
> - Add new BIOS_INPUTS_MAX macro and replace hardcoded values
>
> drivers/platform/x86/amd/pmf/pmf.h | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h
> index bd19f2a6bc78..2145df4128cd 100644
> --- a/drivers/platform/x86/amd/pmf/pmf.h
> +++ b/drivers/platform/x86/amd/pmf/pmf.h
> @@ -119,6 +119,7 @@ struct cookie_header {
>
> #define APTS_MAX_STATES 16
> #define CUSTOM_BIOS_INPUT_BITS GENMASK(16, 7)
> +#define BIOS_INPUTS_MAX 10
>
> typedef void (*apmf_event_handler_t)(acpi_handle handle, u32 event, void *data);
>
> @@ -204,7 +205,7 @@ struct apmf_sbios_req_v1 {
> u8 skin_temp_apu;
> u8 skin_temp_hs2;
> u8 enable_cnqf;
> - u32 custom_policy[10];
> + u32 custom_policy[BIOS_INPUTS_MAX];
> } __packed;
>
> struct apmf_sbios_req_v2 {
> @@ -216,7 +217,7 @@ struct apmf_sbios_req_v2 {
> u32 stt_min_limit;
> u8 skin_temp_apu;
> u8 skin_temp_hs2;
> - u32 custom_policy[10];
> + u32 custom_policy[BIOS_INPUTS_MAX];
> } __packed;
>
> struct apmf_fan_idx {
> @@ -355,7 +356,7 @@ enum power_modes_v2 {
> };
>
> struct pmf_bios_inputs_prev {
> - u32 custom_bios_inputs[10];
> + u32 custom_bios_inputs[BIOS_INPUTS_MAX];
> };
>
> struct amd_pmf_dev {
> @@ -451,7 +452,7 @@ struct os_power_slider {
> struct amd_pmf_notify_smart_pc_update {
> u16 size;
> u32 pending_req;
> - u32 custom_bios[10];
> + u32 custom_bios[BIOS_INPUTS_MAX];
> } __packed;
>
> struct fan_table_control {
next prev parent reply other threads:[~2025-10-15 14:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 14:54 [PATCH v2 1/2] platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size Shyam Sundar S K
2025-10-15 14:54 ` [PATCH v2 2/2] platform/x86/amd/pmf: Use ring buffer to store custom BIOS input values Shyam Sundar S K
2025-10-15 15:03 ` Mario Limonciello
2025-10-16 8:13 ` Shen, Yijun
2025-11-05 16:46 ` Ilpo Järvinen
2025-11-07 6:58 ` Shyam Sundar S K
2025-11-07 10:22 ` Ilpo Järvinen
2025-11-07 10:41 ` Shyam Sundar S K
2025-10-15 14:59 ` Mario Limonciello [this message]
2025-10-16 8:13 ` [PATCH v2 1/2] platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size Shen, Yijun
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=1f69a884-fee5-434e-8d65-89bbc721276b@kernel.org \
--to=superm1@kernel.org \
--cc=Patil.Reddy@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=Yijun.Shen@Dell.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.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