intel_pstate: Optimize calculation for max/min_perf_adj
authorPhilippe Longepe <philippe.longepe@linux.intel.com>
Sun, 6 Mar 2016 07:34:04 +0000 (08:34 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Mar 2016 23:04:58 +0000 (00:04 +0100)
commita158bed5dc92bd83338225135d448958e0b3745d
tree6d7a975d9efd6809b3379e91b2351b11947a979c
parentb54a0dfd56d5c314302987e0ff173b3f1bfcb555
intel_pstate: Optimize calculation for max/min_perf_adj

mul_fp(int_tofp(A), B) expands to:
((A << FRAC_BITS) * B) >> FRAC_BITS, so the same result can be obtained
via simple multiplication A * B.  Apply this observation to
max_perf * limits->max_perf and max_perf * limits->min_perf in
intel_pstate_get_min_max()."

Signed-off-by: Philippe Longepe <philippe.longepe@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c