Patchwork [net] udp: remove a useless initialization

login
register
mail settings
Submitter Amerigo Wang
Date May 8, 2013, 3:04 a.m.
Message ID <1367982246-10730-1-git-send-email-amwang@redhat.com>
Download mbox | patch
Permalink /patch/242492/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Amerigo Wang - May 8, 2013, 3:04 a.m.
'inner_eth' is not used until it is assigned with the same
value later.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pravin B Shelar - May 8, 2013, 4:17 a.m.
On Tue, May 7, 2013 at 8:04 PM, Cong Wang <amwang@redhat.com> wrote:
> 'inner_eth' is not used until it is assigned with the same
> value later.
>
since you are at this code, can you also pull inner ether header?

Thanks,
Pravin.
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Pravin B Shelar <pshelar@nicira.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
>
> ---
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 0ae038a..3d036bdd 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -2311,7 +2311,7 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
>         struct sk_buff *segs = ERR_PTR(-EINVAL);
>         int mac_len = skb->mac_len;
>         int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
> -       struct ethhdr *inner_eth = (struct ethhdr *)skb_inner_mac_header(skb);
> +       struct ethhdr *inner_eth;
>         __be16 protocol = skb->protocol;
>         netdev_features_t enc_features;
>         int outer_hlen;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 0ae038a..3d036bdd 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2311,7 +2311,7 @@  static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
 	struct sk_buff *segs = ERR_PTR(-EINVAL);
 	int mac_len = skb->mac_len;
 	int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
-	struct ethhdr *inner_eth = (struct ethhdr *)skb_inner_mac_header(skb);
+	struct ethhdr *inner_eth;
 	__be16 protocol = skb->protocol;
 	netdev_features_t enc_features;
 	int outer_hlen;