Skip to contentSkip to conversation

staging: rtl8192u: Fix sparse warnings about endianness

PATCH New maomao xu 1 participant 1 message Feb 15, 2017 Staging

lore
Share & tools
lore

maomao xu

author
#0 lore raw

PATCH 1/1 staging: rtl8192u: Fix sparse warnings about endianness

drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:175:36: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:175:36: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c:175:36: got restricted __be16 [usertype] <noident>

drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +1 -1
index 949c496..a1da90a 100644
@@ -172,7 +172,7 @@ static inline int ieee80211_put_snap(u8 *data, u16 h_proto)
 	snap->oui[1] = oui[1];
 	snap->oui[2] = oui[2];
 
-	*(u16 *)(data + SNAP_SIZE) = htons(h_proto);
+	put_unaligned_be16(h_proto, data + SNAP_SIZE);
 
 	return SNAP_SIZE + sizeof(u16);
 }
Signature · 1 line
1.7.9.5