mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-24 15:24:03 +00:00
cpufreq: intel_pstate: Avoid redundant initialization of local vars
After commit 1a4fe38add
("cpufreq: intel_pstate: Remove max/min
fractions to limit performance") the initial value of the pstate local
variable in intel_pstate_max_within_limits() and the initial value of
the max_pstate local variable in intel_pstate_prepare_request() are
both immediately discarded, so initialize both these variables to
their target values upfront.
No intentional changes of behavior.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
6c8d750f97
commit
fa93b51c55
1 changed files with 3 additions and 7 deletions
|
@ -1471,11 +1471,9 @@ static void intel_pstate_set_min_pstate(struct cpudata *cpu)
|
||||||
|
|
||||||
static void intel_pstate_max_within_limits(struct cpudata *cpu)
|
static void intel_pstate_max_within_limits(struct cpudata *cpu)
|
||||||
{
|
{
|
||||||
int pstate;
|
int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio);
|
||||||
|
|
||||||
update_turbo_state();
|
update_turbo_state();
|
||||||
pstate = intel_pstate_get_base_pstate(cpu);
|
|
||||||
pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio);
|
|
||||||
intel_pstate_set_pstate(cpu, pstate);
|
intel_pstate_set_pstate(cpu, pstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1716,11 +1714,9 @@ static inline int32_t get_target_pstate(struct cpudata *cpu)
|
||||||
|
|
||||||
static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate)
|
static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate)
|
||||||
{
|
{
|
||||||
int max_pstate = intel_pstate_get_base_pstate(cpu);
|
int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio);
|
||||||
int min_pstate;
|
int max_pstate = max(min_pstate, cpu->max_perf_ratio);
|
||||||
|
|
||||||
min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio);
|
|
||||||
max_pstate = max(min_pstate, cpu->max_perf_ratio);
|
|
||||||
return clamp_t(int, pstate, min_pstate, max_pstate);
|
return clamp_t(int, pstate, min_pstate, max_pstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue