Commit b989bc0
committed
cpufreq: intel_pstate: Simplify intel_pstate_update_perf_limits()
Because pstate.max_freq is always equal to the product of
pstate.max_pstate and pstate.scaling and, analogously,
pstate.turbo_freq is always equal to the product of
pstate.turbo_pstate and pstate.scaling, the result of the
max_policy_perf computation in intel_pstate_update_perf_limits() is
always equal to the quotient of policy_max and pstate.scaling,
regardless of whether or not turbo is disabled. Analogously, the
result of min_policy_perf in intel_pstate_update_perf_limits() is
always equal to the quotient of policy_min and pstate.scaling.
Accordingly, intel_pstate_update_perf_limits() need not check
whether or not turbo is enabled at all and in order to compute
max_policy_perf and min_policy_perf it can always divide policy_max
and policy_min, respectively, by pstate.scaling. Make it do so.
While at it, move the definition and initialization of the
turbo_max local variable to the code branch using it.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>1 parent 60943bb commit b989bc0
1 file changed
Lines changed: 6 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2195 | 2195 | | |
2196 | 2196 | | |
2197 | 2197 | | |
| 2198 | + | |
2198 | 2199 | | |
2199 | | - | |
2200 | | - | |
2201 | 2200 | | |
2202 | 2201 | | |
2203 | 2202 | | |
| |||
2206 | 2205 | | |
2207 | 2206 | | |
2208 | 2207 | | |
2209 | | - | |
2210 | | - | |
2211 | | - | |
2212 | | - | |
2213 | | - | |
2214 | | - | |
2215 | | - | |
2216 | | - | |
2217 | | - | |
2218 | | - | |
2219 | | - | |
| 2208 | + | |
2220 | 2209 | | |
2221 | 2210 | | |
2222 | 2211 | | |
2223 | | - | |
| 2212 | + | |
2224 | 2213 | | |
2225 | 2214 | | |
2226 | 2215 | | |
2227 | 2216 | | |
2228 | | - | |
2229 | | - | |
| 2217 | + | |
| 2218 | + | |
2230 | 2219 | | |
2231 | 2220 | | |
2232 | 2221 | | |
2233 | 2222 | | |
2234 | 2223 | | |
2235 | 2224 | | |
| 2225 | + | |
2236 | 2226 | | |
2237 | 2227 | | |
2238 | 2228 | | |
| |||
0 commit comments