mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
cpufreq/amd-pstate: Make amd_pstate_get_mode_string() never return NULL
amd_pstate_get_mode_string() is only used by amd-pstate-ut. Set the
failure path to use AMD_PSTATE_UNDEFINED ("undefined") to avoid showing
"(null)" as a string when running test suite.
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
This commit is contained in:
parent
06791bc017
commit
baf106f3a7
1 changed files with 2 additions and 2 deletions
|
|
@ -70,8 +70,8 @@ static_assert(ARRAY_SIZE(amd_pstate_mode_string) == AMD_PSTATE_MAX);
|
|||
|
||||
const char *amd_pstate_get_mode_string(enum amd_pstate_mode mode)
|
||||
{
|
||||
if (mode < 0 || mode >= AMD_PSTATE_MAX)
|
||||
return NULL;
|
||||
if (mode < AMD_PSTATE_UNDEFINED || mode >= AMD_PSTATE_MAX)
|
||||
mode = AMD_PSTATE_UNDEFINED;
|
||||
return amd_pstate_mode_string[mode];
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(amd_pstate_get_mode_string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue