[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1316207763-3281-1-git-send-email-xingchao.wang@intel.com>
Date: Fri, 16 Sep 2011 17:16:03 -0400
From: Wang Xingchao <xingchao.wang@...el.com>
To: linux-kernel@...r.kernel.org
Cc: peterz@...radead.org, pjt@...gle.com, yong.zhang0@...il.com,
Wang Xingchao <xingchao.wang@...el.com>
Subject: [PATCH] sched: remove NULL pointer check
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@...el.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists