Skip to content

Commit f8fde68

Browse files
committed
cpufreq/amd-pstate: Drop ret variable from amd_pstate_set_energy_pref_index()
The ret variable is not necessary. Reviewed-and-tested-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Link: https://lore.kernel.org/r/20241209185248.16301-14-mario.limonciello@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent fff3957 commit f8fde68

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,11 @@ static int shmem_set_epp(struct amd_cpudata *cpudata, u32 epp)
319319
static int amd_pstate_set_energy_pref_index(struct amd_cpudata *cpudata,
320320
int pref_index)
321321
{
322-
int epp = -EINVAL;
323-
int ret;
322+
int epp;
324323

325324
if (!pref_index)
326325
epp = cpudata->epp_default;
327-
328-
if (epp == -EINVAL)
326+
else
329327
epp = epp_values[pref_index];
330328

331329
if (epp > 0 && cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) {
@@ -341,9 +339,7 @@ static int amd_pstate_set_energy_pref_index(struct amd_cpudata *cpudata,
341339
cpudata->boost_state);
342340
}
343341

344-
ret = amd_pstate_set_epp(cpudata, epp);
345-
346-
return ret;
342+
return amd_pstate_set_epp(cpudata, epp);
347343
}
348344

349345
static inline int msr_cppc_enable(bool enable)

0 commit comments

Comments
 (0)