Skip to content

Commit 2bd038d

Browse files
Shyam Sundar S Kij-intel
authored andcommitted
platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
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. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> 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: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/20251119085813.546813-1-Shyam-sundar.S-k@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 1d1b8b0 commit 2bd038d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • drivers/platform/x86/amd/pmf

drivers/platform/x86/amd/pmf/pmf.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct cookie_header {
119119

120120
#define APTS_MAX_STATES 16
121121
#define CUSTOM_BIOS_INPUT_BITS GENMASK(16, 7)
122+
#define BIOS_INPUTS_MAX 10
122123

123124
/* amd_pmf_send_cmd() set/get */
124125
#define SET_CMD false
@@ -210,7 +211,7 @@ struct apmf_sbios_req_v1 {
210211
u8 skin_temp_apu;
211212
u8 skin_temp_hs2;
212213
u8 enable_cnqf;
213-
u32 custom_policy[10];
214+
u32 custom_policy[BIOS_INPUTS_MAX];
214215
} __packed;
215216

216217
struct apmf_sbios_req_v2 {
@@ -222,7 +223,7 @@ struct apmf_sbios_req_v2 {
222223
u32 stt_min_limit;
223224
u8 skin_temp_apu;
224225
u8 skin_temp_hs2;
225-
u32 custom_policy[10];
226+
u32 custom_policy[BIOS_INPUTS_MAX];
226227
} __packed;
227228

228229
struct apmf_fan_idx {
@@ -361,7 +362,7 @@ enum power_modes_v2 {
361362
};
362363

363364
struct pmf_bios_inputs_prev {
364-
u32 custom_bios_inputs[10];
365+
u32 custom_bios_inputs[BIOS_INPUTS_MAX];
365366
};
366367

367368
struct amd_pmf_dev {
@@ -457,7 +458,7 @@ struct os_power_slider {
457458
struct amd_pmf_notify_smart_pc_update {
458459
u16 size;
459460
u32 pending_req;
460-
u32 custom_bios[10];
461+
u32 custom_bios[BIOS_INPUTS_MAX];
461462
} __packed;
462463

463464
struct fan_table_control {

0 commit comments

Comments
 (0)