From: Xiaotian Feng <dfeng@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Xiaotian Feng <dfeng@redhat.com>,
Suresh Siddha <suresh.b.siddha@intel.com>,
Venkatesh Pallipadi <venki@google.com>,
Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH -tip] rbtree: avoid func twice when node doesn't have a right sibling
Date: Tue, 13 Jul 2010 18:30:54 +0800 [thread overview]
Message-ID: <1279017054-3024-1-git-send-email-dfeng@redhat.com> (raw)
In rb_augment_path(),
if (node == parent->rb_left && parent->rb_right)
func(parent->rb_right, data);
else if (parent->rb_left)
func(parent->rb_left, data);
If (node == parent->rb_left && !parent->rb_right), then kernel will
func(node,data) twice.
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Venkatesh Pallipadi <venki@google.com>
Cc: Xiaotian Feng <dfeng@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
lib/rbtree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/rbtree.c b/lib/rbtree.c
index 4693f79..7bb8f7f 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -295,7 +295,7 @@ up:
if (node == parent->rb_left && parent->rb_right)
func(parent->rb_right, data);
- else if (parent->rb_left)
+ else if (node == parent->rb_right && parent->rb_left)
func(parent->rb_left, data);
node = parent;
--
1.7.1.1
reply other threads:[~2010-07-13 10:31 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=1279017054-3024-1-git-send-email-dfeng@redhat.com \
--to=dfeng@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=venki@google.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®