mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Xingchao <xingchao.wang@intel.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, pjt@google.com, yong.zhang0@gmail.com,
	Wang Xingchao <xingchao.wang@intel.com>
Subject: [PATCH] sched: remove NULL pointer check
Date: Fri, 16 Sep 2011 17:16:03 -0400	[thread overview]
Message-ID: <1316207763-3281-1-git-send-email-xingchao.wang@intel.com> (raw)

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


                 reply	other threads:[~2011-09-16  9:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316207763-3281-1-git-send-email-xingchao.wang@intel.com \
    --to=xingchao.wang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=yong.zhang0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®