mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rbtree: Remove unneeded check condition in rb_find_first
@ 2021-09-30  7:16 Li RongQing
  2021-09-30 22:58 ` Michel Lespinasse
  0 siblings, 1 reply; 3+ messages in thread
From: Li RongQing @ 2021-09-30  7:16 UTC (permalink / raw)
  To: linux-kernel, michel

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 <<michel@lespinasse.org>>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 include/linux/rbtree.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 235047d..d5ac8f7 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -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;
 		}
 	}
-- 
1.7.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-22  4:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30  7:16 [PATCH] rbtree: Remove unneeded check condition in rb_find_first Li RongQing
2021-09-30 22:58 ` Michel Lespinasse
2021-10-22  4:19   ` 答复: " Li,Rongqing

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®