[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230530181145.2880-1-kunyu@nfschina.com>
Date: Wed, 31 May 2023 02:11:45 +0800
From: Li kunyu <kunyu@...china.com>
To: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, vschneid@...hat.com
Cc: linux-kernel@...r.kernel.org, Li kunyu <kunyu@...china.com>
Subject: [PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task()
Using the while statement instead of the if and goto statements is more
concise and efficient.
Signed-off-by: Li kunyu <kunyu@...china.com>
---
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
Powered by blists - more mailing lists