From: Martin Karamihov Date: Mon, 17 Apr 2017 17:00:25 +0000 (+0300) Subject: staging: rtl8192u: fix incorrect type in assignment in ieee80211_tx.c X-Git-Tag: v4.12-rc1~84^2~116 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=18125dc003bd4fbb95c37d5be796f3536df445df;p=karo-tx-linux.git staging: rtl8192u: fix incorrect type in assignment in ieee80211_tx.c This patch fixes the following sparse warning: ieee80211_tx.c:174:36: incorrect type in assignment (different base types) ieee80211_tx.c:174:36: expected unsigned short [unsigned] [short] [usertype] ieee80211_tx.c:174:36: got restricted __be16 [usertype] by adding left side cast to __be16. Signed-off-by: Martin Karamihov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 7afdd058716a..bdb96a45a9eb 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -171,7 +171,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); + *(__be16 *)(data + SNAP_SIZE) = htons(h_proto); return SNAP_SIZE + sizeof(u16); }