summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-11 20:10:42 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-11 23:58:37 +0300
commit8edb0a6e48d147bb2aa466c58e03c52d2b0d6ee7 (patch)
tree3bccdcdaa490245a0ca4b3a408fb75e7358f71de /drivers/cpufreq
parenta1c9787dc38097d554f9da8372031b3d6f8c140a (diff)
downloadlinux-8edb0a6e48d147bb2aa466c58e03c52d2b0d6ee7.tar.xz
intel_pstate: Use sample.core_avg_perf in get_avg_pstate()
Notice that get_avg_pstate() can use sample.core_avg_perf instead of carrying the same division again, so make it do that. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/intel_pstate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 19712e27ad50..ff5c591578ee 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1218,8 +1218,8 @@ static inline int32_t get_avg_frequency(struct cpudata *cpu)
static inline int32_t get_avg_pstate(struct cpudata *cpu)
{
- return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf,
- cpu->sample.mperf);
+ return mul_ext_fp(cpu->pstate.max_pstate_physical,
+ cpu->sample.core_avg_perf);
}
static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)