public inbox for linux-kernel@vger.kernel.org
 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
  0 siblings, 1 reply; 5+ 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] 5+ messages in thread

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

Thread overview: 5+ 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
     [not found]     ` <SG2PR06MB3743FFC941CC9B242113A8A4BD2DA@SG2PR06MB3743.apcprd06.prod.outlook.com>
2023-07-07  5:24       ` 回复: " Christophe JAILLET
     [not found]   ` <SG2PR06MB37437B48A4A7B0902222CDD9BD2DA@SG2PR06MB3743.apcprd06.prod.outlook.com>
2023-07-07  1:54     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox