Skip to content

Commit 5f98ced

Browse files
committed
cpufreq: intel_pstate: Drop redundant wrapper function
intel_pstate_hwp_set_policy() is a wrapper around intel_pstate_hwp_set(), but the only value it adds is to check hwp_active before calling the latter and one of its two callers has already checked hwp_active before that happens, so in that code path the additional check is redundant and using the wrapper is rather pointless. For this reason, drop intel_pstate_hwp_set_policy() and make its callers invoke intel_pstate_hwp_set() directly (after checking hwp_active). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 4495c08 commit 5f98ced

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -930,14 +930,6 @@ static void intel_pstate_hwp_set(struct cpufreq_policy *policy)
930930
}
931931
}
932932

933-
static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy)
934-
{
935-
if (hwp_active)
936-
intel_pstate_hwp_set(policy);
937-
938-
return 0;
939-
}
940-
941933
static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy)
942934
{
943935
struct cpudata *cpu_data = all_cpu_data[policy->cpu];
@@ -952,20 +944,17 @@ static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy)
952944

953945
static int intel_pstate_resume(struct cpufreq_policy *policy)
954946
{
955-
int ret;
956-
957947
if (!hwp_active)
958948
return 0;
959949

960950
mutex_lock(&intel_pstate_limits_lock);
961951

962952
all_cpu_data[policy->cpu]->epp_policy = 0;
963-
964-
ret = intel_pstate_hwp_set_policy(policy);
953+
intel_pstate_hwp_set(policy);
965954

966955
mutex_unlock(&intel_pstate_limits_lock);
967956

968-
return ret;
957+
return 0;
969958
}
970959

971960
static void intel_pstate_update_policies(void)
@@ -2169,7 +2158,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
21692158

21702159
intel_pstate_set_update_util_hook(policy->cpu);
21712160

2172-
intel_pstate_hwp_set_policy(policy);
2161+
if (hwp_active)
2162+
intel_pstate_hwp_set(policy);
21732163

21742164
mutex_unlock(&intel_pstate_limits_lock);
21752165

0 commit comments

Comments
 (0)