lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1632986196-20074-1-git-send-email-lirongqing@baidu.com>
Date:   Thu, 30 Sep 2021 15:16:36 +0800
From:   Li RongQing <lirongqing@...du.com>
To:     linux-kernel@...r.kernel.org, michel@...pinasse.org
Subject: [PATCH] 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 <<michel@...pinasse.org>>
Signed-off-by: Li RongQing <lirongqing@...du.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ