mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Ming <machel@vivo.com>
To: Jon Maloy <jmaloy@redhat.com>, Ying Xue <ying.xue@windriver.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com, Wang Ming <machel@vivo.com>
Subject: [PATCH v1] net:tipc:Remove repeated initialization
Date: Thu,  6 Jul 2023 21:42:09 +0800	[thread overview]
Message-ID: <20230706134226.9119-1-machel@vivo.com> (raw)

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


             reply	other threads:[~2023-07-06 13:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 13:42 Wang Ming [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230706134226.9119-1-machel@vivo.com \
    --to=machel@vivo.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jmaloy@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=pabeni@redhat.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®