net: bridge: remove unneeded variable 'err'
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 <yuehaibing@huawei.com> Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8937388acb
commit
a26d94bff4
|
@ -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)
|
int br_multicast_toggle(struct net_bridge *br, unsigned long val)
|
||||||
{
|
{
|
||||||
struct net_bridge_port *port;
|
struct net_bridge_port *port;
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
spin_lock_bh(&br->multicast_lock);
|
spin_lock_bh(&br->multicast_lock);
|
||||||
if (!!br_opt_get(br, BROPT_MULTICAST_ENABLED) == !!val)
|
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:
|
unlock:
|
||||||
spin_unlock_bh(&br->multicast_lock);
|
spin_unlock_bh(&br->multicast_lock);
|
||||||
|
|
||||||
return err;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool br_multicast_enabled(const struct net_device *dev)
|
bool br_multicast_enabled(const struct net_device *dev)
|
||||||
|
|
|
@ -1175,9 +1175,7 @@ static int br_changelink(struct net_device *brdev, struct nlattr *tb[],
|
||||||
if (data[IFLA_BR_MCAST_SNOOPING]) {
|
if (data[IFLA_BR_MCAST_SNOOPING]) {
|
||||||
u8 mcast_snooping = nla_get_u8(data[IFLA_BR_MCAST_SNOOPING]);
|
u8 mcast_snooping = nla_get_u8(data[IFLA_BR_MCAST_SNOOPING]);
|
||||||
|
|
||||||
err = br_multicast_toggle(br, mcast_snooping);
|
br_multicast_toggle(br, mcast_snooping);
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data[IFLA_BR_MCAST_QUERY_USE_IFADDR]) {
|
if (data[IFLA_BR_MCAST_QUERY_USE_IFADDR]) {
|
||||||
|
|
Loading…
Reference in New Issue