mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
timers/migration: Clean up the loop in tmigr_quick_check()
Make the logic easier to follow: - Remove the final return statement, which is never reached, and move the actual walk-terminating return statement out of the do-while loop. - Remove the else-clause to reduce indentation. If a non-lonely group is encountered during the walk, the loop is immediately terminated with a return statement anyway; no need for an else. Signed-off-by: Petr Tesarik <ptesarik@suse.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Link: https://lore.kernel.org/all/20250606124818.455560-1-ptesarik@suse.com
This commit is contained in:
parent
19272b37aa
commit
ff56a3e2a8
@ -1405,9 +1405,9 @@ u64 tmigr_quick_check(u64 nextevt)
|
||||
return KTIME_MAX;
|
||||
|
||||
do {
|
||||
if (!tmigr_check_lonely(group)) {
|
||||
if (!tmigr_check_lonely(group))
|
||||
return KTIME_MAX;
|
||||
} else {
|
||||
|
||||
/*
|
||||
* Since current CPU is active, events may not be sorted
|
||||
* from bottom to the top because the CPU's event is ignored
|
||||
@ -1415,13 +1415,10 @@ u64 tmigr_quick_check(u64 nextevt)
|
||||
* Thus keep track of the lowest observed expiry.
|
||||
*/
|
||||
nextevt = min_t(u64, nextevt, READ_ONCE(group->next_expiry));
|
||||
if (!group->parent)
|
||||
return nextevt;
|
||||
}
|
||||
group = group->parent;
|
||||
} while (group);
|
||||
|
||||
return KTIME_MAX;
|
||||
return nextevt;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user