Skip to contentSkip to conversation

mac80211: clarify alignment comment

PATCH New Johannes Berg 1 participant 1 message Feb 20, 2013 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: clarify alignment comment

From: Johannes Berg <[email protected]>

The comment says something about __skb_push(), but that isn't even called in the code any more. Looking at the git history, that comment never even made sense when it was still called, so just replace that part to note it still works even when align isn't 0 or 2.

---
 net/mac80211/rx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/mac80211/rx.c +4 -2
index bb73ed2d..acf006f 100644
@@ -1894,8 +1894,10 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
 		 * 'align' will only take the values 0 or 2 here
 		 * since all frames are required to be aligned
 		 * to 2-byte boundaries when being passed to
-		 * mac80211. That also explains the __skb_push()
-		 * below.
+		 * mac80211; the code here works just as well if
+		 * that isn't true, but mac80211 assumes it can
+		 * access fields as 2-byte aligned (e.g. for
+		 * compare_ether_addr)
 		 */
 		align = ((unsigned long)(skb->data + sizeof(struct ethhdr))) & 3;
 		if (align) {
Signature · 1 line
1.8.0