mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-18 02:46:06 +00:00
cpuidle: teo: Get rid of redundant check in teo_update()
Notice that setting measured_us to UINT_MAX in teo_update() earlier doesn't change the behavior of the following code, so do that and eliminate a redundant check used for setting measured_us to UINT_MAX. This change is not expected to alter functionality. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
cab09f3d2d
commit
b7e7fffd3e
@ -123,10 +123,11 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
|||||||
|
|
||||||
if (cpu_data->time_span_ns >= cpu_data->sleep_length_ns) {
|
if (cpu_data->time_span_ns >= cpu_data->sleep_length_ns) {
|
||||||
/*
|
/*
|
||||||
* One of the safety nets has triggered or this was a timer
|
* One of the safety nets has triggered or the wakeup was close
|
||||||
* wakeup (or equivalent).
|
* enough to the closest timer event expected at the idle state
|
||||||
|
* selection time to be discarded.
|
||||||
*/
|
*/
|
||||||
measured_us = sleep_length_us;
|
measured_us = UINT_MAX;
|
||||||
} else {
|
} else {
|
||||||
unsigned int lat;
|
unsigned int lat;
|
||||||
|
|
||||||
@ -188,15 +189,6 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
|||||||
cpu_data->states[idx_timer].hits = hits;
|
cpu_data->states[idx_timer].hits = hits;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* If the total time span between idle state selection and the "reflect"
|
|
||||||
* callback is greater than or equal to the sleep length determined at
|
|
||||||
* the idle state selection time, the wakeup is likely to be due to a
|
|
||||||
* timer event.
|
|
||||||
*/
|
|
||||||
if (cpu_data->time_span_ns >= cpu_data->sleep_length_ns)
|
|
||||||
measured_us = UINT_MAX;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Save idle duration values corresponding to non-timer wakeups for
|
* Save idle duration values corresponding to non-timer wakeups for
|
||||||
* pattern detection.
|
* pattern detection.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user