rbtree: Remove unneeded check condition in rb_find_first
PATCH 1/1 rbtree: Remove unneeded check condition in rb_find_first
the variable c is int type, so change the following condition
if (c <= 0) {
}
else if (c > 0) {
}
as:
if (c <= 0) {
}
else {
}Spotted-by Michel Lespinasse <<[email protected]>>
Signed-off-by Li RongQing <[email protected]>
--- include/linux/rbtree.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/rbtree.h +1 -1
@@ -294,7 +294,7 @@ static inline void rb_replace_node_cached(struct rb_node *victim,if (!c) match = node; node = node->rb_left; - }else if (c >0 ) { + }else { node = node->rb_right; } }
Signature · 1 line
1.7.1
Quoted 27 lines · Li RongQing
the variable c is int type, so change the following condition
if (c <= 0) { } else if (c > 0) { } as: if (c <= 0) { } else { }Spotted-by Michel Lespinasse <<[email protected]>>Signed-off-by Li RongQing <[email protected]>--- include/linux/rbtree.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/linux/rbtree.h +0
-0
include/linux/rbtree.h static inline void rb_replace_node_cached(struct rb_node *victim, · line 300
Quoted 8 lines
include/linux/rbtree.h +1
-1@@ -294,7 +294,7 @@ static inline void rb_replace_node_cached(struct rb_node *victim,if (!c) match = node; node = node->rb_left; - }else if (c >0 ) { + }else { node = node->rb_right; } }
Looks good to me, thanks for the fix.
Reviewed-by Michel Lespinasse <[email protected]>
--
Michel "walken" Lespinasse
Ping
-Li
Quoted 44 lines · Li RongQing
include/linux/rbtree.h static inline void rb_replace_node_cached(struct
Quoted 27 lines
the variable c is int type, so change the following condition
if (c <= 0) { } else if (c > 0) { } as: if (c <= 0) { } else { }Spotted-by Michel Lespinasse <<[email protected]>>Signed-off-by Li RongQing <[email protected]>--- include/linux/rbtree.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/linux/rbtree.h index renamed from include/linux/rbtree.h +0
-0235047d..d5ac8f7 100644
include/linux/rbtree.h +0
-0@@ -294,7 +294,7 @@ static inline void rb_replace_node_cached(struct
rb_node*victim,include/linux/rbtree.h static inline void rb_replace_node_cached(struct rb_node *victim, · line 300
Quoted 8 lines
include/linux/rbtree.h +1
-1if (!c) match = node; node = node->rb_left; - }else if (c >0 ) { + }else { node = node->rb_right; } }Looks good to me, thanks for the fix.
Reviewed-by Michel Lespinasse <[email protected]>--
Michel "walken" Lespinasse