diff options
author | Antonio Quartulli <ordex@autistici.org> | 2013-04-08 09:08:18 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-05-28 20:44:54 -0400 |
commit | 7ed4be9523455a061e62236dc3caa9211cd7edda (patch) | |
tree | 476ba10f0a15e50ff9f5409f4a4f4ee0e1388a47 /net/batman-adv/bridge_loop_avoidance.c | |
parent | 7db3fc291bb22bf43667b009dd0e701ed4eb7c96 (diff) |
batman-adv: use eth_hdr() when it makes sense
Instead of casting the result of skb_mac_header() to
"struct ethhdr *" every time, the eth_hdr inline function
can be use to beautify the code and improve its readability.
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r-- | net/batman-adv/bridge_loop_avoidance.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 379061c72549..082189e2e40d 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -864,7 +864,7 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv, | |||
864 | short vid = -1; | 864 | short vid = -1; |
865 | int ret; | 865 | int ret; |
866 | 866 | ||
867 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 867 | ethhdr = eth_hdr(skb); |
868 | 868 | ||
869 | if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) { | 869 | if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) { |
870 | vhdr = (struct vlan_ethhdr *)ethhdr; | 870 | vhdr = (struct vlan_ethhdr *)ethhdr; |
@@ -885,7 +885,7 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv, | |||
885 | return 0; | 885 | return 0; |
886 | 886 | ||
887 | /* pskb_may_pull() may have modified the pointers, get ethhdr again */ | 887 | /* pskb_may_pull() may have modified the pointers, get ethhdr again */ |
888 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 888 | ethhdr = eth_hdr(skb); |
889 | arphdr = (struct arphdr *)((uint8_t *)ethhdr + headlen); | 889 | arphdr = (struct arphdr *)((uint8_t *)ethhdr + headlen); |
890 | 890 | ||
891 | /* Check whether the ARP frame carries a valid | 891 | /* Check whether the ARP frame carries a valid |
@@ -1432,7 +1432,7 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid, | |||
1432 | struct batadv_hard_iface *primary_if; | 1432 | struct batadv_hard_iface *primary_if; |
1433 | int ret; | 1433 | int ret; |
1434 | 1434 | ||
1435 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 1435 | ethhdr = eth_hdr(skb); |
1436 | 1436 | ||
1437 | primary_if = batadv_primary_if_get_selected(bat_priv); | 1437 | primary_if = batadv_primary_if_get_selected(bat_priv); |
1438 | if (!primary_if) | 1438 | if (!primary_if) |
@@ -1539,7 +1539,7 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid) | |||
1539 | if (batadv_bla_process_claim(bat_priv, primary_if, skb)) | 1539 | if (batadv_bla_process_claim(bat_priv, primary_if, skb)) |
1540 | goto handled; | 1540 | goto handled; |
1541 | 1541 | ||
1542 | ethhdr = (struct ethhdr *)skb_mac_header(skb); | 1542 | ethhdr = eth_hdr(skb); |
1543 | 1543 | ||
1544 | if (unlikely(atomic_read(&bat_priv->bla.num_requests))) | 1544 | if (unlikely(atomic_read(&bat_priv->bla.num_requests))) |
1545 | /* don't allow broadcasts while requests are in flight */ | 1545 | /* don't allow broadcasts while requests are in flight */ |