summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Limonciello (AMD) <superm1@kernel.org>2025-10-09 11:17:52 -0500
committerMario Limonciello (AMD) <superm1@kernel.org>2025-11-10 23:35:20 -0600
commit06791bc017ea0793dae71553163c9107e91c415b (patch)
treed59e4192496122f6c6961002cbdbc19a507804a8
parent7e17f48667b6707593fc215cbe025157920934f1 (diff)
cpufreq/amd-pstate: Drop NULL value from amd_pstate_mode_string
None of the users actually look for the NULL value. To avoid risk of regression introducing a new value but forgetting to add a string add a static assert to test AMD_PSTATE_MAX matches the array size. Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
-rw-r--r--drivers/cpufreq/amd-pstate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 0bc501344887..a5b9e5baf423 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -65,8 +65,8 @@ static const char * const amd_pstate_mode_string[] = {
[AMD_PSTATE_PASSIVE] = "passive",
[AMD_PSTATE_ACTIVE] = "active",
[AMD_PSTATE_GUIDED] = "guided",
- NULL,
};
+static_assert(ARRAY_SIZE(amd_pstate_mode_string) == AMD_PSTATE_MAX);
const char *amd_pstate_get_mode_string(enum amd_pstate_mode mode)
{