lkml.org 
[lkml]   [2018]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio()
Date
When CONFIG_RT_GROUP_SCHED is not configured, group_rt_rq() will
return NULL. With this patch applied, we also can get the same result.
Because the compiler will help us optimize the code.

So, we can remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio().

Signed-off-by: Muchun Song <smuchun@gmail.com>
---
kernel/sched/rt.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index a21ea6021929..47b4800761db 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -894,12 +894,10 @@ static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun)

static inline int rt_se_prio(struct sched_rt_entity *rt_se)
{
-#ifdef CONFIG_RT_GROUP_SCHED
struct rt_rq *rt_rq = group_rt_rq(rt_se);

if (rt_rq)
return rt_rq->highest_prio.curr;
-#endif

return rt_task_of(rt_se)->prio;
}
--
2.17.1
\
 
 \ /
  Last update: 2018-10-30 15:46    [W:0.059 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site