The err is not used after initalization, So remove it and make
it void function.
Signed-off-by: zhong jiang <[email protected]>
---
net/bridge/br_multicast.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 920665d..dc26c53 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)
@@ -1797,7 +1795,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
struct sk_buff *skb_trimmed = NULL;
const unsigned char *src;
struct igmphdr *ih;
- int err;
+ int err = 0;
err = ip_mc_check_igmp(skb, &skb_trimmed);
@@ -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
On Sun, 5 Aug 2018 22:18:43 +0800
zhong jiang <[email protected]> wrote:
> The err is not used after initalization, So remove it and make
> it void function.
>
> Signed-off-by: zhong jiang <[email protected]>
Makes sense to me.
Acked-by: Stephen Hemminger <[email protected]>
From: zhong jiang <[email protected]>
Date: Sun, 5 Aug 2018 22:18:43 +0800
> @@ -1797,7 +1795,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
> struct sk_buff *skb_trimmed = NULL;
> const unsigned char *src;
> struct igmphdr *ih;
> - int err;
> + int err = 0;
>
> err = ip_mc_check_igmp(skb, &skb_trimmed);
The initialization of err to '0' is unnecessary, it gets assigned on
the very next line.
On 2018/8/6 8:33, David Miller wrote:
> From: zhong jiang <[email protected]>
> Date: Sun, 5 Aug 2018 22:18:43 +0800
>
>> @@ -1797,7 +1795,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
>> struct sk_buff *skb_trimmed = NULL;
>> const unsigned char *src;
>> struct igmphdr *ih;
>> - int err;
>> + int err = 0;
>>
>> err = ip_mc_check_igmp(skb, &skb_trimmed);
> The initialization of err to '0' is unnecessary, it gets assigned on
> the very next line.
>
> .
>
That's right. I will drop that change and repost.
Thanks,
zhong jiang