[PATCH] sched: rt: Simplify pick_task_rt()

From: Li kunyu
Date: Wed Apr 05 2023 - 22:59:31 EST


Remove useless intermediate variable "p" and its initialization.
Directly return the next RT scheduling task obtained from
_pick_next_task_rt().

Signed-off-by: Li kunyu <kunyu@xxxxxxxxxxxx>
---
kernel/sched/rt.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index e9b1c08c20a7..71c930fafac5 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1799,14 +1799,10 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq)

static struct task_struct *pick_task_rt(struct rq *rq)
{
- struct task_struct *p;
-
if (!sched_rt_runnable(rq))
return NULL;

- p = _pick_next_task_rt(rq);
-
- return p;
+ return _pick_next_task_rt(rq);
}

static struct task_struct *pick_next_task_rt(struct rq *rq)
--
2.18.2