From: Frederic Weisbecker Date: Tue, 14 Jan 2025 23:15:07 +0000 (+0100) Subject: timers/migration: Simplify top level detection on group setup X-Git-Tag: v6.14-rc1~181^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dcf6230555dcd0b05e8d2dd5b128dcc4b6fc04ef;p=thirdparty%2Fkernel%2Flinux.git timers/migration: Simplify top level detection on group setup Having a single group on a given level is enough to know this is the top level, because a root has to have at least two children, unless that root is the only group and the children are actual CPUs. Simplify the test in tmigr_setup_groups() accordingly. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250114231507.21672-5-frederic@kernel.org --- diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c index 8d57f7686bb03..61633762f6bf9 100644 --- a/kernel/time/timer_migration.c +++ b/kernel/time/timer_migration.c @@ -1624,9 +1624,7 @@ static int tmigr_setup_groups(unsigned int cpu, unsigned int node) * be different from tmigr_hierarchy_levels, contains only a * single group. */ - if (group->parent || i == tmigr_hierarchy_levels || - (list_empty(&tmigr_level_list[i]) && - list_is_singular(&tmigr_level_list[i - 1]))) + if (group->parent || list_is_singular(&tmigr_level_list[i - 1])) break; } while (i < tmigr_hierarchy_levels);