* [PATCH] sched: remove NULL pointer check
@ 2011-09-16 21:16 Wang Xingchao
0 siblings, 0 replies; only message in thread
From: Wang Xingchao @ 2011-09-16 21:16 UTC (permalink / raw)
To: linux-kernel; +Cc: peterz, pjt, yong.zhang0, Wang Xingchao
cfs_rq->rb_leftmost is always true when calling __pick_first/last_entity(),
so it's safe to remove the NULL pointer check.
Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
---
kernel/sched_fair.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index fef0bfd..55c67b5 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -417,9 +417,6 @@ static struct sched_entity *__pick_first_entity(struct cfs_rq *cfs_rq)
{
struct rb_node *left = cfs_rq->rb_leftmost;
- if (!left)
- return NULL;
-
return rb_entry(left, struct sched_entity, run_node);
}
@@ -438,9 +435,6 @@ static struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
{
struct rb_node *last = rb_last(&cfs_rq->tasks_timeline);
- if (!last)
- return NULL;
-
return rb_entry(last, struct sched_entity, run_node);
}
--
1.7.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-09-16 9:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16 21:16 [PATCH] sched: remove NULL pointer check Wang Xingchao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®