[PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task()
From: Li kunyu
Date: Sun May 28 2023 - 21:40:57 EST
Using the while statement instead of the if and goto statements is more
concise and efficient.
Signed-off-by: Li kunyu <kunyu@xxxxxxxxxxxx>
---
kernel/sched/deadline.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index d823e608c7f0..b94a498f8cd9 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -2112,15 +2112,13 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
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 (pick_dl_task(rq, p, cpu))
return p;
next_node = rb_next(next_node);
- goto next_node;
}
return NULL;
--
2.18.2