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>
This commit is contained in:
parent
4495c08e84
commit
5f98ced1c9
|
@ -930,14 +930,6 @@ skip_epp:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy)
|
|
||||||
{
|
|
||||||
if (hwp_active)
|
|
||||||
intel_pstate_hwp_set(policy);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy)
|
static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy)
|
||||||
{
|
{
|
||||||
struct cpudata *cpu_data = all_cpu_data[policy->cpu];
|
struct cpudata *cpu_data = all_cpu_data[policy->cpu];
|
||||||
|
@ -952,20 +944,17 @@ static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy)
|
||||||
|
|
||||||
static int intel_pstate_resume(struct cpufreq_policy *policy)
|
static int intel_pstate_resume(struct cpufreq_policy *policy)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!hwp_active)
|
if (!hwp_active)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
mutex_lock(&intel_pstate_limits_lock);
|
mutex_lock(&intel_pstate_limits_lock);
|
||||||
|
|
||||||
all_cpu_data[policy->cpu]->epp_policy = 0;
|
all_cpu_data[policy->cpu]->epp_policy = 0;
|
||||||
|
intel_pstate_hwp_set(policy);
|
||||||
ret = intel_pstate_hwp_set_policy(policy);
|
|
||||||
|
|
||||||
mutex_unlock(&intel_pstate_limits_lock);
|
mutex_unlock(&intel_pstate_limits_lock);
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void intel_pstate_update_policies(void)
|
static void intel_pstate_update_policies(void)
|
||||||
|
@ -2169,7 +2158,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
|
||||||
|
|
||||||
intel_pstate_set_update_util_hook(policy->cpu);
|
intel_pstate_set_update_util_hook(policy->cpu);
|
||||||
|
|
||||||
intel_pstate_hwp_set_policy(policy);
|
if (hwp_active)
|
||||||
|
intel_pstate_hwp_set(policy);
|
||||||
|
|
||||||
mutex_unlock(&intel_pstate_limits_lock);
|
mutex_unlock(&intel_pstate_limits_lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue