]> git.samba.org - sfrench/cifs-2.6.git/commit
cpufreq: intel_pstate: Eliminate intel_pstate_get_min_max()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Mar 2017 22:24:26 +0000 (00:24 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 Mar 2017 21:12:17 +0000 (23:12 +0200)
commitb02aabe8ab9757a7dd5aa50e201a6d970f7e7a2f
tree6e05a7ec23661adf1f79c943af57c1909278f9f5
parent2bfc4cbb5fd3848669f1b95fea793f63d8e77fa0
cpufreq: intel_pstate: Eliminate intel_pstate_get_min_max()

Some computations in intel_pstate_get_min_max() are not necessary
and one of its two callers doesn't even use the full result.

First off, the fixed-point value of cpu->max_perf represents a
non-negative number between 0 and 1 inclusive and cpu->min_perf
cannot be greater than cpu->max_perf.  It is not necessary to check
those conditions every time the numbers in question are used.

Moreover, since intel_pstate_max_within_limits() only needs the
upper boundary, it doesn't make sense to compute the lower one in
there and returning min and max from intel_pstate_get_min_max()
via pointers doesn't look particularly nice.

For the above reasons, drop intel_pstate_get_min_max(), add a helper
to get the base P-state for min/max computations and carry out them
directly in the previous callers of intel_pstate_get_min_max().

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c