Skip to content

Commit 06791bc

Browse files
committed
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>
1 parent 7e17f48 commit 06791bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ static const char * const amd_pstate_mode_string[] = {
6565
[AMD_PSTATE_PASSIVE] = "passive",
6666
[AMD_PSTATE_ACTIVE] = "active",
6767
[AMD_PSTATE_GUIDED] = "guided",
68-
NULL,
6968
};
69+
static_assert(ARRAY_SIZE(amd_pstate_mode_string) == AMD_PSTATE_MAX);
7070

7171
const char *amd_pstate_get_mode_string(enum amd_pstate_mode mode)
7272
{

0 commit comments

Comments
 (0)