Skip to content

Commit ff56a3e

Browse files
ptesarikKAGA-KOKO
authored andcommitted
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
1 parent 19272b3 commit ff56a3e

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

kernel/time/timer_migration.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,23 +1405,20 @@ u64 tmigr_quick_check(u64 nextevt)
14051405
return KTIME_MAX;
14061406

14071407
do {
1408-
if (!tmigr_check_lonely(group)) {
1408+
if (!tmigr_check_lonely(group))
14091409
return KTIME_MAX;
1410-
} else {
1411-
/*
1412-
* Since current CPU is active, events may not be sorted
1413-
* from bottom to the top because the CPU's event is ignored
1414-
* up to the top and its sibling's events not propagated upwards.
1415-
* Thus keep track of the lowest observed expiry.
1416-
*/
1417-
nextevt = min_t(u64, nextevt, READ_ONCE(group->next_expiry));
1418-
if (!group->parent)
1419-
return nextevt;
1420-
}
1410+
1411+
/*
1412+
* Since current CPU is active, events may not be sorted
1413+
* from bottom to the top because the CPU's event is ignored
1414+
* up to the top and its sibling's events not propagated upwards.
1415+
* Thus keep track of the lowest observed expiry.
1416+
*/
1417+
nextevt = min_t(u64, nextevt, READ_ONCE(group->next_expiry));
14211418
group = group->parent;
14221419
} while (group);
14231420

1424-
return KTIME_MAX;
1421+
return nextevt;
14251422
}
14261423

14271424
/*

0 commit comments

Comments
 (0)