staging: rtl8723au: fix incorrect type in assignment warning
PATCH 1/1 staging: rtl8723au: fix incorrect type in assignment warning
Repaced call to htons with call to cpu_to_be16s to fix the
following sparse warning:drivers/staging/rtl8723au/core/rtw_recv.c:1557:21: warning: incorrect type in assignment (different base types)drivers/staging/rtl8723au/core/rtw_recv.c:1557:21: expected unsigned short [unsigned] [assigned] [usertype] lendrivers/staging/rtl8723au/core/rtw_recv.c:1557:21: got restricted __be16 [usertype] <noident>
--- drivers/staging/rtl8723au/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723au/core/rtw_recv.c +1 -1
@@ -1554,7 +1554,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)ether_addr_copy (ptr +ETH_ALEN , pattrib->src);if (!bsnaphdr) { - len =htons (len); +cpu_to_be16s (&len);memcpy (ptr +12 , &len,2 ); }
Signature · 1 line
2.4.6
Quoted 16 lines · Steve Pennington
Repaced call to htons with call to
cpu_to_be16sto fix the
following sparse warning:drivers/staging/rtl8723au/core/rtw_recv.c:1557:21: warning: incorrect type in assignment (different base types)drivers/staging/rtl8723au/core/rtw_recv.c:1557:21: expected unsigned short [unsigned] [assigned] [usertype] lendrivers/staging/rtl8723au/core/rtw_recv.c:1557:21: got restricted__be16[usertype] <noident>Signed-off-by Steve Pennington <[email protected]>--- drivers/staging/rtl8723au/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723au/core/rtw_recv.c +0
-0
drivers/staging/rtl8723au/core/rtw_recv.c static int wlanhdr_to_ethhdr (struct recv_frame *precvframe) · line 1559
Quoted 7 lines
drivers/staging/rtl8723au/core/rtw_recv.c +1
-1@@ -1554,7 +1554,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)ether_addr_copy (ptr +ETH_ALEN , pattrib->src);if (!bsnaphdr) { - len =htons (len); +cpu_to_be16s (&len);memcpy (ptr +12 , &len,2 ); }
Thats an awful fix - use put_unaligned_le16() instead.
Jes