summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/intel_pstate.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-11-12 20:25:15 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-12-11 19:53:58 +0100
commit2554c32f0b84df1f506546125c9d15c8044a2ec2 (patch)
tree9eb2dd381cc533d2db88e4f88a914a11e98142fc /drivers/cpufreq/intel_pstate.c
parent42807537b6a08b280612c1d456f33d876af74af3 (diff)
downloadlinux-2554c32f0b84df1f506546125c9d15c8044a2ec2.tar.bz2
cpufreq: intel_pstate: Simplify intel_cpufreq_update_pstate()
Avoid doing the same assignment in both branches of a conditional, do it after the whole conditional instead. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/intel_pstate.c')
-rw-r--r--drivers/cpufreq/intel_pstate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 36a3ccfe6d3d..2a4db856222f 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2569,14 +2569,13 @@ static int intel_cpufreq_update_pstate(struct cpufreq_policy *policy,
int old_pstate = cpu->pstate.current_pstate;
target_pstate = intel_pstate_prepare_request(cpu, target_pstate);
- if (hwp_active) {
+ if (hwp_active)
intel_cpufreq_adjust_hwp(cpu, target_pstate,
policy->strict_target, fast_switch);
- cpu->pstate.current_pstate = target_pstate;
- } else if (target_pstate != old_pstate) {
+ else if (target_pstate != old_pstate)
intel_cpufreq_adjust_perf_ctl(cpu, target_pstate, fast_switch);
- cpu->pstate.current_pstate = target_pstate;
- }
+
+ cpu->pstate.current_pstate = target_pstate;
intel_cpufreq_trace(cpu, fast_switch ? INTEL_PSTATE_TRACE_FAST_SWITCH :
INTEL_PSTATE_TRACE_TARGET, old_pstate);