* [PATCH v2] net/bridge/br_multicast: remove redundant variable "err"
@ 2018-08-06 3:07 zhong jiang
2018-08-06 17:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-08-06 3:07 UTC (permalink / raw)
To: davem, stephen; +Cc: netdev, linux-kernel
The err is not modified after initalization, So remove it and make
it to be void function.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
v1->v2:
- The initalization of err to '0' is unnecesary. so drop the change
net/bridge/br_multicast.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 920665d..20ed7ad 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1423,10 +1423,10 @@ static void br_multicast_query_received(struct net_bridge *br,
br_multicast_mark_router(br, port);
}
-static int br_ip4_multicast_query(struct net_bridge *br,
- struct net_bridge_port *port,
- struct sk_buff *skb,
- u16 vid)
+static void br_ip4_multicast_query(struct net_bridge *br,
+ struct net_bridge_port *port,
+ struct sk_buff *skb,
+ u16 vid)
{
const struct iphdr *iph = ip_hdr(skb);
struct igmphdr *ih = igmp_hdr(skb);
@@ -1439,7 +1439,6 @@ static int br_ip4_multicast_query(struct net_bridge *br,
unsigned long now = jiffies;
unsigned int offset = skb_transport_offset(skb);
__be32 group;
- int err = 0;
spin_lock(&br->multicast_lock);
if (!netif_running(br->dev) ||
@@ -1498,7 +1497,6 @@ static int br_ip4_multicast_query(struct net_bridge *br,
out:
spin_unlock(&br->multicast_lock);
- return err;
}
#if IS_ENABLED(CONFIG_IPV6)
@@ -1828,7 +1826,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
err = br_ip4_multicast_igmp3_report(br, port, skb_trimmed, vid);
break;
case IGMP_HOST_MEMBERSHIP_QUERY:
- err = br_ip4_multicast_query(br, port, skb_trimmed, vid);
+ br_ip4_multicast_query(br, port, skb_trimmed, vid);
break;
case IGMP_HOST_LEAVE_MESSAGE:
br_ip4_multicast_leave_group(br, port, ih->group, vid, src);
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] net/bridge/br_multicast: remove redundant variable "err"
2018-08-06 3:07 [PATCH v2] net/bridge/br_multicast: remove redundant variable "err" zhong jiang
@ 2018-08-06 17:34 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-08-06 17:34 UTC (permalink / raw)
To: zhongjiang; +Cc: stephen, netdev, linux-kernel
From: zhong jiang <zhongjiang@huawei.com>
Date: Mon, 6 Aug 2018 11:07:23 +0800
> The err is not modified after initalization, So remove it and make
> it to be void function.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> v1->v2:
> - The initalization of err to '0' is unnecesary. so drop the change
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-06 17:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06 3:07 [PATCH v2] net/bridge/br_multicast: remove redundant variable "err" zhong jiang
2018-08-06 17:34 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).