sched: rt: Simplify pick_task_rt()

Message ID 20230407192435.3390-1-kunyu@nfschina.com
State New
Headers
Series sched: rt: Simplify pick_task_rt() |

Commit Message

Li kunyu April 7, 2023, 7:24 p.m. UTC
  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@nfschina.com>
---
 kernel/sched/rt.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Patch

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)