Skip to content

Commit b78f8c8

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Remove the cppc_state check in offline/online functions
Only amd_pstate_epp driver (i.e. cppc_state = ACTIVE) enters the amd_pstate_epp_offline() and amd_pstate_epp_cpu_online() functions, so remove the unnecessary if condition checking if cppc_state is equal to AMD_PSTATE_ACTIVE. Signed-off-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Link: https://lore.kernel.org/r/20241204144842.164178-5-Dhananjay.Ugwekar@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent b1089e0 commit b78f8c8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,10 +1651,8 @@ static int amd_pstate_epp_cpu_online(struct cpufreq_policy *policy)
16511651

16521652
pr_debug("AMD CPU Core %d going online\n", cpudata->cpu);
16531653

1654-
if (cppc_state == AMD_PSTATE_ACTIVE) {
1655-
amd_pstate_epp_reenable(cpudata);
1656-
cpudata->suspended = false;
1657-
}
1654+
amd_pstate_epp_reenable(cpudata);
1655+
cpudata->suspended = false;
16581656

16591657
return 0;
16601658
}
@@ -1683,8 +1681,7 @@ static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy)
16831681
if (cpudata->suspended)
16841682
return 0;
16851683

1686-
if (cppc_state == AMD_PSTATE_ACTIVE)
1687-
amd_pstate_epp_offline(policy);
1684+
amd_pstate_epp_offline(policy);
16881685

16891686
return 0;
16901687
}

0 commit comments

Comments
 (0)