intel_pstate: Use sample.core_avg_perf in get_avg_pstate()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 11 May 2016 17:10:42 +0000 (19:10 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 11 May 2016 20:58:37 +0000 (22:58 +0200)
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>
drivers/cpufreq/intel_pstate.c

index 19712e2..ff5c591 100644 (file)
@@ -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)