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>] [day] [month] [year] [list]
Message-Id: <20211018085627.854672-1-luo.penghao@zte.com.cn>
Date:   Mon, 18 Oct 2021 08:56:27 +0000
From:   luo penghao <cgel.zte@...il.com>
To:     Stephen Rothwell <sfr@...b.auug.org.au>
Cc:     linux-kernel@...r.kernel.org, luo penghao <luo.penghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] lib: Remove redundant statement

Regardless of whether the next if condition causes the function to return,
the assignment operation is meaningless.

The clang_analyzer complains as follows:

lib/assoc_array.c:97:3 warning:
lib/assoc_array.c:409:3 warning:

Value stored to 'cursor' is never read.

Reported-by: Zeal Robot <zealci@....com.cn>>
Signed-off-by: luo penghao <luo.penghao@....com.cn>
---
 lib/assoc_array.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/assoc_array.c b/lib/assoc_array.c
index 079c72e..2743bca 100644
--- a/lib/assoc_array.c
+++ b/lib/assoc_array.c
@@ -94,7 +94,6 @@ static int assoc_array_subtree_iterate(const struct assoc_array_ptr *root,
 
 	if (assoc_array_ptr_is_shortcut(parent)) {
 		shortcut = assoc_array_ptr_to_shortcut(parent);
-		cursor = parent;
 		parent = READ_ONCE(shortcut->back_pointer); /* Address dependency. */
 		slot = shortcut->parent_slot;
 		if (parent == stop)
@@ -406,7 +405,6 @@ static void assoc_array_destroy_subtree(struct assoc_array_ptr *root,
 	if (assoc_array_ptr_is_shortcut(parent)) {
 		shortcut = assoc_array_ptr_to_shortcut(parent);
 		BUG_ON(shortcut->next_node != cursor);
-		cursor = parent;
 		parent = shortcut->back_pointer;
 		slot = shortcut->parent_slot;
 		pr_devel("free shortcut\n");
-- 
2.15.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ