mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
cpuidle: teo: Combine candidate state index checks against 0
There are two candidate state index checks against 0 in teo_select() that need not be separate, so combine them and update comments around them. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Christian Loehle <christian.loehle@arm.com> Tested-by: Aboorva Devarajan <aboorvad@linux.ibm.com> Tested-by: Christian Loehle <christian.loehle@arm.com> Link: https://patch.msgid.link/13676346.uLZWGnKmhe@rjwysocki.net
This commit is contained in:
@@ -436,23 +436,18 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
|
|||||||
if (idx > constraint_idx)
|
if (idx > constraint_idx)
|
||||||
idx = constraint_idx;
|
idx = constraint_idx;
|
||||||
|
|
||||||
if (!idx && prev_intercept_idx) {
|
if (!idx) {
|
||||||
/*
|
if (prev_intercept_idx) {
|
||||||
* We have to query the sleep length here otherwise we don't
|
/*
|
||||||
* know after wakeup if our guess was correct.
|
* Query the sleep length to be able to count the wakeup
|
||||||
*/
|
* as a hit if it is caused by a timer.
|
||||||
duration_ns = tick_nohz_get_sleep_length(&delta_tick);
|
*/
|
||||||
cpu_data->sleep_length_ns = duration_ns;
|
duration_ns = tick_nohz_get_sleep_length(&delta_tick);
|
||||||
|
cpu_data->sleep_length_ns = duration_ns;
|
||||||
|
}
|
||||||
goto out_tick;
|
goto out_tick;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Skip the timers check if state 0 is the current candidate one,
|
|
||||||
* because an immediate non-timer wakeup is expected in that case.
|
|
||||||
*/
|
|
||||||
if (!idx)
|
|
||||||
goto out_tick;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If state 0 is a polling one, check if the target residency of
|
* If state 0 is a polling one, check if the target residency of
|
||||||
* the current candidate state is low enough and skip the timers
|
* the current candidate state is low enough and skip the timers
|
||||||
|
|||||||
Reference in New Issue
Block a user