diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-08-10 02:08:56 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-08-10 02:08:56 +0300 |
commit | a891283e56362543d1d276e192266069ef52075b (patch) | |
tree | 014a666f8572605b2b90cecf8949679a714ff6e1 /drivers/cpufreq | |
parent | 3714c281c679e3fd34944e6321ccc814d76c6c62 (diff) | |
download | linux-a891283e56362543d1d276e192266069ef52075b.tar.xz |
cpufreq: intel_pstate: Simplify intel_pstate_adjust_pstate()
Since there is only one P-state selection routine in intel_pstate
now, make intel_pstate_adjust_pstate() call it directly and drop
the target_pstate argument from that function.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/intel_pstate.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 942cd6888b54..e519940fa57c 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1495,13 +1495,15 @@ static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); } -static void intel_pstate_adjust_pstate(struct cpudata *cpu, int target_pstate) +static void intel_pstate_adjust_pstate(struct cpudata *cpu) { int from = cpu->pstate.current_pstate; struct sample *sample; + int target_pstate; update_turbo_state(); + target_pstate = get_target_pstate_use_cpu_load(cpu); target_pstate = intel_pstate_prepare_request(cpu, target_pstate); trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); intel_pstate_update_pstate(cpu, target_pstate); @@ -1547,12 +1549,8 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time, return; set_pstate: - if (intel_pstate_sample(cpu, time)) { - int target_pstate; - - target_pstate = get_target_pstate_use_cpu_load(cpu); - intel_pstate_adjust_pstate(cpu, target_pstate); - } + if (intel_pstate_sample(cpu, time)) + intel_pstate_adjust_pstate(cpu); } static struct pstate_funcs core_funcs = { |