Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp142683pxv; Thu, 15 Jul 2021 00:45:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgJOw0Mini7+2mywpGgiQ3hxtzkMTrEJZPOfGksYK0zqBBT1ExAKB5r8C3pSEe2WbJNGqf X-Received: by 2002:aa7:c1cc:: with SMTP id d12mr5010442edp.282.1626335137338; Thu, 15 Jul 2021 00:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626335137; cv=none; d=google.com; s=arc-20160816; b=d2GX6YH0U7j7T8aj9gX5FqdQh5Kb91vOg9657UtBLYK0RMWbhGu9JIUdK5g35upwX0 sbwndu8vmVBEH/Qa4J279uB+Tyv0jZQotpjdju/cfql4oH5nI1TAaL5nN/YNaG470C2o Q3bX/6043Rr6T4M29QD2hyxfjrRipqJGIXVZCdW5C/oNVFktngL4O7Ov1nspqh+mBAHR lJWe6v5ukdUPxNSgZxMORj84Wa5nfchvh2KKyidG7Avis8O4ry2p+Zs6DV0nBqRCoLzE zmpyYp7orz8oXbnXcWxtAhru18XcHdT3bhfydb4YvVBdRlY8jQ+4O0ngGwfDEQalDhYK 4i7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=qzmy22vtGxNQ9QwXd9X5ofTa1eDdi7niNNbh9cI2+4c=; b=cuY8IYDXXTzNMn8bwrmqwO285Xff5mywhWp56g6sOtVjG811KxkHV/lGh7LTaaiLZP XRR6utpIfmaaTjf9qPaPzYY1S8RjEcJ6veWYS5/VNmQh8wTUk+MRDRjykugmnZTTlq9g BlKAo5LzMyYObGuBXjxmjNkk634EKtAzOtQAbe/R+fveqTfIMRlOFfjVm4DjbqTbyE/U dRkV+3YPErACyxCFyrNwEMHfm3q5XDVk66IrIYxSAn+nrzzbQVuGGUap0IGik20XdIYL 2EswIho7yr2/0KC5JwMszwvwO0yiqVSfkErtw9/ZZNPRK++WzGQwaddT4A31g+2OGfQq p32w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o23si6627581ejc.470.2021.07.15.00.45.13; Thu, 15 Jul 2021 00:45:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237376AbhGOEje (ORCPT + 99 others); Thu, 15 Jul 2021 00:39:34 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:38858 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230311AbhGOEjd (ORCPT ); Thu, 15 Jul 2021 00:39:33 -0400 X-UUID: d689f176c0114730ba304c56bea3bc6c-20210715 X-UUID: d689f176c0114730ba304c56bea3bc6c-20210715 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1599588048; Thu, 15 Jul 2021 12:36:37 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Jul 2021 12:36:30 +0800 Received: from localhost.localdomain (10.15.20.246) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 15 Jul 2021 12:36:29 +0800 From: Rocco Yue To: "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Matthias Brugger CC: , , , , , , Rocco Yue Subject: [PATCH v2] net: ipv6: remove unused local variable Date: Thu, 15 Jul 2021 12:20:34 +0800 Message-ID: <20210715042034.6525-1-rocco.yue@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The local variable "struct net *net" in the two functions of inet6_rtm_getaddr() and inet6_dump_addr() are actually useless, so remove them. Signed-off-by: Rocco Yue --- net/ipv6/addrconf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 3bf685fe64b9..e2f625e39455 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -5211,8 +5211,7 @@ static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, .netnsid = -1, .type = type, }; - struct net *net = sock_net(skb->sk); - struct net *tgt_net = net; + struct net *tgt_net = sock_net(skb->sk); int idx, s_idx, s_ip_idx; int h, s_h; struct net_device *dev; @@ -5351,7 +5350,7 @@ static int inet6_rtm_valid_getaddr_req(struct sk_buff *skb, static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr *nlh, struct netlink_ext_ack *extack) { - struct net *net = sock_net(in_skb->sk); + struct net *tgt_net = sock_net(in_skb->sk); struct inet6_fill_args fillargs = { .portid = NETLINK_CB(in_skb).portid, .seq = nlh->nlmsg_seq, @@ -5359,7 +5358,6 @@ static int inet6_rtm_getaddr(struct sk_buff *in_skb, struct nlmsghdr *nlh, .flags = 0, .netnsid = -1, }; - struct net *tgt_net = net; struct ifaddrmsg *ifm; struct nlattr *tb[IFA_MAX+1]; struct in6_addr *addr = NULL, *peer; -- 2.18.0