Commit 9e890a1f authored by Johannes Berg's avatar Johannes Berg

mac80211: neaten ieee80211_deliver_skb

Remove the unnecessary duplicate test of "if (skb) {"
when !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.

Remove now unnecessary __maybe_unused, neaten comment
Remove unnecessary parenthesis around align cast.
Substitute reference to deprecated compare_ether_addr
with ether_addr_equal (in the comment.)
Signed-off-by: default avatarJoe Perches <joe@perches.com>
[edit commit log slightly]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 33dde2bf
...@@ -1962,19 +1962,17 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) ...@@ -1962,19 +1962,17 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
} }
} }
if (skb) {
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
/* if (skb) {
* 'align' will only take the values 0 or 2 here /* 'align' will only take the values 0 or 2 here since all
* since all frames are required to be aligned * frames are required to be aligned to 2-byte boundaries
* to 2-byte boundaries when being passed to * when being passed to mac80211; the code here works just
* mac80211; the code here works just as well if * as well if that isn't true, but mac80211 assumes it can
* that isn't true, but mac80211 assumes it can * access fields as 2-byte aligned (e.g. for ether_addr_equal)
* access fields as 2-byte aligned (e.g. for */
* compare_ether_addr) int align;
*/
int align = ((unsigned long)(skb->data + align = (unsigned long)(skb->data + sizeof(struct ethhdr)) & 3;
sizeof(struct ethhdr))) & 3;
if (align) { if (align) {
if (WARN_ON(skb_headroom(skb) < 3)) { if (WARN_ON(skb_headroom(skb) < 3)) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
...@@ -1987,6 +1985,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) ...@@ -1987,6 +1985,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
skb_set_tail_pointer(skb, len); skb_set_tail_pointer(skb, len);
} }
} }
}
#endif #endif
if (skb) { if (skb) {
...@@ -1995,7 +1994,6 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) ...@@ -1995,7 +1994,6 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
memset(skb->cb, 0, sizeof(skb->cb)); memset(skb->cb, 0, sizeof(skb->cb));
netif_receive_skb(skb); netif_receive_skb(skb);
} }
}
if (xmit_skb) { if (xmit_skb) {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment