[PATCH] avoid return NULL on root rb_node in rb_next/rb_prev

From: Wang Sheng-Hui
Date: Mon Jun 28 2010 - 07:13:33 EST



Signed-off-by: Wang Sheng-Hui <crosslonelyover@xxxxxxxxx>
---
lib/rbtree.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/lib/rbtree.c b/lib/rbtree.c
index 15e10b1..474e9fd 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -356,9 +356,6 @@ struct rb_node *rb_next(const struct rb_node *node)
{
struct rb_node *parent;

- if (rb_parent(node) == node)
- return NULL;
-
/* If we have a right-hand child, go down and then left as far
as we can. */
if (node->rb_right) {
@@ -385,9 +382,6 @@ struct rb_node *rb_prev(const struct rb_node *node)
{
struct rb_node *parent;

- if (rb_parent(node) == node)
- return NULL;
-
/* If we have a left-hand child, go down and then right as far
as we can. */
if (node->rb_left) {
--
1.6.3.3



--


Thanks and Best Regards,
shenghui
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/