diff options
| author | Mario Limonciello (AMD) <superm1@kernel.org> | 2025-10-09 19:17:52 +0300 |
|---|---|---|
| committer | Mario Limonciello (AMD) <superm1@kernel.org> | 2025-11-11 08:35:20 +0300 |
| commit | 06791bc017ea0793dae71553163c9107e91c415b (patch) | |
| tree | d59e4192496122f6c6961002cbdbc19a507804a8 | |
| parent | 7e17f48667b6707593fc215cbe025157920934f1 (diff) | |
| download | linux-06791bc017ea0793dae71553163c9107e91c415b.tar.xz | |
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.c | 2 |
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) { |
