Skip to contentSkip to conversation

udp: remove a useless initialization

PATCH In review Cong Wang 2 participants 2 messages May 8, 2013

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 udp: remove a useless initialization

'inner_eth' is not used until it is assigned with the same value later.

Cc Eric Dumazet <[email protected]>
Cc Pravin B Shelar <[email protected]>
Cc David S. Miller <[email protected]>

---

net/ipv4/udp.c +1 -1
index 0ae038a..3d036bdd 100644
@@ -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;
#1 lore raw
Quoted 3 lines · Cong Wang

'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.

Quoted 19 lines
Cc Eric Dumazet <[email protected]>
Cc Pravin B Shelar <[email protected]>
Cc David S. Miller <[email protected]>

---

net/ipv4/udp.c +1 -1
index 0ae038a..3d036bdd 100644
@@ -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;