From: John Stultz Date: Thu, 5 Dec 2024 23:59:35 +0000 (-0800) Subject: sched: deadline: Cleanup goto label in pick_earliest_pushable_dl_task X-Git-Tag: v6.14-rc1~184^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7675361ff9a1d9038025c05267600d0c762c0236;p=thirdparty%2Fkernel%2Fstable.git sched: deadline: Cleanup goto label in pick_earliest_pushable_dl_task Commit 8b5e770ed7c0 ("sched/deadline: Optimize pull_dl_task()") added a goto label seems would be better written as a while loop. So replace the goto with a while loop, to make it easier to read. Reported-by: Todd Kjos Signed-off-by: John Stultz Reviewed-and-tested-by: K Prateek Nayak Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20241206000009.1226085-1-jstultz@google.com --- diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 33b4646f8b24c..643d101cb96a9 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2516,16 +2516,13 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu return NULL; next_node = rb_first_cached(&rq->dl.pushable_dl_tasks_root); - -next_node: - if (next_node) { + while (next_node) { p = __node_2_pdl(next_node); if (task_is_pushable(rq, p, cpu)) return p; next_node = rb_next(next_node); - goto next_node; } return NULL;