Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2437689imu; Mon, 17 Dec 2018 01:50:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXly384IG+O6iYZFfgScOAfsxvrPeu3jKUNlZOX0WgMaLXXP6iD4gt+LvgKLkqCo3T4KsL X-Received: by 2002:a17:902:209:: with SMTP id 9mr12329088plc.288.1545040224997; Mon, 17 Dec 2018 01:50:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545040224; cv=none; d=google.com; s=arc-20160816; b=pGFqbVp+smAwcfHwcpBbwvgmy9/z9nxrQX+GSFm2H6VyPt4Goj/O0pZ9Xje0YyZvYF LLNY5gsAC89jiHI0HNFmSpnnN7eUqUi+Kpjyd5oXz29WUHUWIcZFZKDSDpucMGg5jKmj ejOVzoO8z3x9/KQ2B2FO57M74+JIVQF7MPawLBvb2IxYVE0HSNgrJaKv4q0sKZxOqdqP 8+WOovo3UNqvJIVrd2g6Spln2PknFStIE8JHkrq7BGKrXznzKHOJ8kMW41O10vJGZEdi J66MQHqNuadTHc60yov8SiKUnBxySByvnmwkLI7Euhu8EVoFjjM82Ra5sD7e83snAfrR Jecg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=tfn+f5Fm32BJnu3pgZSefZgHCDZNO1rMMEmiw9WEiqc=; b=cYICt5pGNkHLThdIXSjkXJsyDKD6pD0motT1y3ao+Tlpo8Go5A6PKIGpBmywLT+E0m LAdgNpMM6QChP3aWiCJ/S/lVZYT7aZZ0sy2oqP45EhvY4XokRRSCkMrdNX+C/F8Blq0e VL8dtobuXicOwi+VteDWA57sY8a0SZaPNCAOZCo6DqouH4lYL0EwD1XCJK9NhwXl1ocD FpO/i+W1+ncAlVVVvGfGyOAcHUhWpeuCD1oO4BRs64k873xgZPT9jw32peXng3ZZeyO7 CYj268DhX0Wptnt0FPFcZkbC+4CFptlcGXb6JAogBPNFkzEo8PXh2x26Wihud7HIR9cN KxvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l64si9936343pge.168.2018.12.17.01.50.09; Mon, 17 Dec 2018 01:50:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732110AbeLQJql (ORCPT + 99 others); Mon, 17 Dec 2018 04:46:41 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:39158 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732021AbeLQJqi (ORCPT ); Mon, 17 Dec 2018 04:46:38 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A8CE08E5AF39E; Mon, 17 Dec 2018 17:46:34 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Mon, 17 Dec 2018 17:46:29 +0800 From: YueHaibing To: , , CC: , , , YueHaibing Subject: [PATCH net-next] net: bridge: remove unneeded variable 'err' Date: Mon, 17 Dec 2018 17:46:23 +0800 Message-ID: <20181217094623.32668-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org function br_multicast_toggle now always return 0, so the variable 'err' is unneeded. Also cleanup dead branch in br_changelink. Signed-off-by: YueHaibing --- net/bridge/br_multicast.c | 3 +-- net/bridge/br_netlink.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 879cd23..3aeff08 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1937,7 +1937,6 @@ static void br_multicast_start_querier(struct net_bridge *br, int br_multicast_toggle(struct net_bridge *br, unsigned long val) { struct net_bridge_port *port; - int err = 0; spin_lock_bh(&br->multicast_lock); if (!!br_opt_get(br, BROPT_MULTICAST_ENABLED) == !!val) @@ -1958,7 +1957,7 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val) unlock: spin_unlock_bh(&br->multicast_lock); - return err; + return 0; } bool br_multicast_enabled(const struct net_device *dev) diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 935495b..9c07591 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c @@ -1175,9 +1175,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[], if (data[IFLA_BR_MCAST_SNOOPING]) { u8 mcast_snooping = nla_get_u8(data[IFLA_BR_MCAST_SNOOPING]); - err = br_multicast_toggle(br, mcast_snooping); - if (err) - return err; + br_multicast_toggle(br, mcast_snooping); } if (data[IFLA_BR_MCAST_QUERY_USE_IFADDR]) { -- 2.7.0