Commit 278ff70
platform/x86/amd/pmf: Refactor repetitive BIOS output handling
Replace repetitive switch-case statements for PMF_POLICY_BIOS_OUTPUT_*
with a helper function and consolidated case handling. This reduces code
duplication and improves maintainability.
The 10 BIOS output policies (PMF_POLICY_BIOS_OUTPUT_1 through
PMF_POLICY_BIOS_OUTPUT_10) previously each had individual case statements
with identical logic. This patch introduces
amd_pmf_get_bios_output_idx() to map policy values to array indices,
consolidating the handling into a single case block with fallthrough.
Also, add a new function amd_pmf_update_bios_output() to simplify the code
handling.
This approach handles non-sequential policy enum values gracefully and
makes future additions easier to implement.
No functional changes.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://patch.msgid.link/20251127091038.2088387-1-Shyam-sundar.S-k@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>1 parent 5c14bff commit 278ff70
1 file changed
Lines changed: 42 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
76 | 113 | | |
77 | 114 | | |
| 115 | + | |
78 | 116 | | |
79 | 117 | | |
80 | 118 | | |
81 | 119 | | |
82 | | - | |
83 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
84 | 123 | | |
85 | 124 | | |
86 | 125 | | |
| |||
183 | 222 | | |
184 | 223 | | |
185 | 224 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 225 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | 226 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | 227 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 228 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | 229 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | 230 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | 231 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 232 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 233 | | |
222 | | - | |
| 234 | + | |
223 | 235 | | |
224 | 236 | | |
225 | 237 | | |
| |||
0 commit comments