netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] net:tipc:Remove repeated initialization
@ 2023-07-06 13:42 Wang Ming
  2023-07-06 15:47 ` Jakub Kicinski
  2023-07-06 18:50 ` [PATCH] net: tipc: Remove repeated “initialization” Markus Elfring
  0 siblings, 2 replies; 10+ messages in thread
From: Wang Ming @ 2023-07-06 13:42 UTC (permalink / raw)
  To: Jon Maloy, Ying Xue, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, tipc-discussion,
	linux-kernel
  Cc: opensource.kernel, Wang Ming

The original code initializes 'tmp' twice,
which causes duplicate initialization issue.
To fix this, we remove the second initialization
of 'tmp' and use 'parent' directly forsubsequent
operations.

Signed-off-by: Wang Ming <machel@vivo.com>
---
 net/tipc/group.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/tipc/group.c b/net/tipc/group.c
index 3e137d8c9d2f..b2f964f62c36 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -284,8 +284,6 @@ static int tipc_group_add_to_tree(struct tipc_group *grp,
 	n = &grp->members.rb_node;
 	while (*n) {
 		tmp = container_of(*n, struct tipc_member, tree_node);
-		parent = *n;
-		tmp = container_of(parent, struct tipc_member, tree_node);
 		nkey = (u64)tmp->node << 32 | tmp->port;
 		if (key < nkey)
 			n = &(*n)->rb_left;
-- 
2.25.1


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

end of thread, other threads:[~2023-07-07 10:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-06 13:42 [PATCH v1] net:tipc:Remove repeated initialization Wang Ming
2023-07-06 15:47 ` Jakub Kicinski
2023-07-06 17:13   ` Christophe JAILLET
2023-07-07  1:24     ` 回复: " 王明-软件底层技术部
2023-07-07  5:24       ` Christophe JAILLET
2023-07-07  6:42         ` net: tipc: Remove repeated “initialization” in tipc_group_add_to_tree() Markus Elfring
2023-07-07 10:25           ` Tung Quang Nguyen
2023-07-07  1:21   ` 回复: [PATCH v1] net:tipc:Remove repeated initialization 王明-软件底层技术部
2023-07-07  1:54     ` Jakub Kicinski
2023-07-06 18:50 ` [PATCH] net: tipc: Remove repeated “initialization” Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).