mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-25 11:55:37 +00:00
cpuidle: teo: Avoid unnecessary variable assignments
Notice that it is not necessary to assign tick_intercept_sum in every iteration of the first loop over idle states in teo_select(), because the intercept_sum value does not change after the assignment in a given iteration of the loop, so its value after the last iteration of the loop can be used for computing the tick_intercept_sum value directly. Modify the code accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
5484e31bbb
commit
78aabcb321
1 changed files with 2 additions and 3 deletions
|
@ -450,8 +450,6 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
|
||||||
hit_sum += prev_bin->hits;
|
hit_sum += prev_bin->hits;
|
||||||
recent_sum += prev_bin->recent;
|
recent_sum += prev_bin->recent;
|
||||||
|
|
||||||
tick_intercept_sum = intercept_sum;
|
|
||||||
|
|
||||||
if (dev->states_usage[i].disable)
|
if (dev->states_usage[i].disable)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -484,7 +482,8 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
tick_intercept_sum += cpu_data->state_bins[drv->state_count-1].intercepts;
|
tick_intercept_sum = intercept_sum +
|
||||||
|
cpu_data->state_bins[drv->state_count-1].intercepts;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the sum of the intercepts metric for all of the idle states
|
* If the sum of the intercepts metric for all of the idle states
|
||||||
|
|
Loading…
Reference in a new issue