Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Shyam Sundar S K and committed by
Ilpo Järvinen
2bd038de 1d1b8b07

+5 -4
+5 -4
drivers/platform/x86/amd/pmf/pmf.h
··· 119 119 120 120 #define APTS_MAX_STATES 16 121 121 #define CUSTOM_BIOS_INPUT_BITS GENMASK(16, 7) 122 + #define BIOS_INPUTS_MAX 10 122 123 123 124 /* amd_pmf_send_cmd() set/get */ 124 125 #define SET_CMD false ··· 211 210 u8 skin_temp_apu; 212 211 u8 skin_temp_hs2; 213 212 u8 enable_cnqf; 214 - u32 custom_policy[10]; 213 + u32 custom_policy[BIOS_INPUTS_MAX]; 215 214 } __packed; 216 215 217 216 struct apmf_sbios_req_v2 { ··· 223 222 u32 stt_min_limit; 224 223 u8 skin_temp_apu; 225 224 u8 skin_temp_hs2; 226 - u32 custom_policy[10]; 225 + u32 custom_policy[BIOS_INPUTS_MAX]; 227 226 } __packed; 228 227 229 228 struct apmf_fan_idx { ··· 362 361 }; 363 362 364 363 struct pmf_bios_inputs_prev { 365 - u32 custom_bios_inputs[10]; 364 + u32 custom_bios_inputs[BIOS_INPUTS_MAX]; 366 365 }; 367 366 368 367 struct amd_pmf_dev { ··· 458 457 struct amd_pmf_notify_smart_pc_update { 459 458 u16 size; 460 459 u32 pending_req; 461 - u32 custom_bios[10]; 460 + u32 custom_bios[BIOS_INPUTS_MAX]; 462 461 } __packed; 463 462 464 463 struct fan_table_control {