sched: deadline: Simplify pick_earliest_pushable_dl_task()
PATCH 1/1 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 <[email protected]>
--- kernel/sched/deadline.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/sched/deadline.c +1 -3
@@ -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 ;
Signature · 1 line
2.18.2
Quoted 4 lines · Li kunyu
Using the while statement instead of the if and goto statements is more concise and efficient.
Signed-off-by Li kunyu <[email protected]>
LGTM, Thanks.
Reviewed-by Mukesh Ojha <[email protected]>
-- Mukesh
Quoted 25 lines
--- kernel/sched/deadline.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)kernel/sched/deadline.c +1
-3@@ -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 ;