The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio()
@ 2018-10-30 14:45 Muchun Song
  2018-10-30 15:13 ` kbuild test robot
  0 siblings, 1 reply; 3+ messages in thread
From: Muchun Song @ 2018-10-30 14:45 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-30 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-30 14:45 [PATCH] sched/rt: Remove unnecessary CONFIG_RT_GROUP_SCHED in rt_se_prio() Muchun Song
2018-10-30 15:13 ` kbuild test robot
2018-10-30 15:42   ` 宋牧春

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox