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: <20230619090336.145738-1-mmpgouride@gmail.com>
Date:   Mon, 19 Jun 2023 09:03:36 +0000
From:   Alan Huang <mmpgouride@...il.com>
To:     paulmck@...nel.org
Cc:     edumazet@...gle.com, linux-kernel@...r.kernel.org,
        Alan Huang <mmpgouride@...il.com>
Subject: [PATCH] list: Remove unnecessary WRITE_ONCE()

Commit c54a2744497d("list: Add hlist_unhashed_lockless()") added
various WRITE_ONCE() to pair with the READ_ONCE() in
hlist_unhashed_lockless(), but there is no need to protect
->next with WRITE_ONCE(). Therefore, this commit removes those
unnecessary WRITE_ONCE().

Signed-off-by: Alan Huang <mmpgouride@...il.com>
---
 include/linux/list.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/list.h b/include/linux/list.h
index f10344dbad..ac366958ea 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -940,7 +940,7 @@ static inline void hlist_del_init(struct hlist_node *n)
 static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
 {
 	struct hlist_node *first = h->first;
-	WRITE_ONCE(n->next, first);
+	n->next = first;
 	if (first)
 		WRITE_ONCE(first->pprev, &n->next);
 	WRITE_ONCE(h->first, n);
@@ -956,7 +956,7 @@ static inline void hlist_add_before(struct hlist_node *n,
 				    struct hlist_node *next)
 {
 	WRITE_ONCE(n->pprev, next->pprev);
-	WRITE_ONCE(n->next, next);
+	n->next = next;
 	WRITE_ONCE(next->pprev, &n->next);
 	WRITE_ONCE(*(n->pprev), n);
 }
@@ -969,8 +969,8 @@ static inline void hlist_add_before(struct hlist_node *n,
 static inline void hlist_add_behind(struct hlist_node *n,
 				    struct hlist_node *prev)
 {
-	WRITE_ONCE(n->next, prev->next);
-	WRITE_ONCE(prev->next, n);
+	n->next = prev->next;
+	prev->next = n;
 	WRITE_ONCE(n->pprev, &prev->next);
 
 	if (n->next)
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ