]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: rtl8723au: fix incorrect type in assignment warning
authorSteve Pennington <sgpenn@gmail.com>
Wed, 22 Jul 2015 17:50:11 +0000 (12:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jul 2015 04:14:08 +0000 (21:14 -0700)
Repaced calls to htons and memcpy with a single call to put_unaligned_be16
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] len
drivers/staging/rtl8723au/core/rtw_recv.c:1557:21:    got restricted __be16 [usertype] <noident>

Signed-off-by: Steve Pennington <sgpenn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_recv.c

index 274a4b65c0226d33581f3cfde71e7ca04ad940ba..ad0549c66529057dac8fe4ed5264df7666c95e39 100644 (file)
@@ -1554,8 +1554,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)
        ether_addr_copy(ptr + ETH_ALEN, pattrib->src);
 
        if (!bsnaphdr) {
-               len = htons(len);
-               memcpy(ptr + 12, &len, 2);
+               put_unaligned_be16(len, ptr + 12);
        }