Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: r8712u: Fix Sparse endian warning in rtl871x_recv.c

Sparse reports the following:
CHECK drivers/staging/rtl8712/rtl871x_recv.c
drivers/staging/rtl8712/rtl871x_recv.c:657:21: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8712/rtl871x_recv.c:657:21: expected unsigned short [unsigned] [assigned] [usertype] len
drivers/staging/rtl8712/rtl871x_recv.c:657:21: got restricted __be16 [usertype] <noident>

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Larry Finger and committed by
Greg Kroah-Hartman
43d60f9b 07222e53

+3 -2
+3 -2
drivers/staging/rtl8712/rtl871x_recv.c
··· 654 654 memcpy(ptr, pattrib->dst, ETH_ALEN); 655 655 memcpy(ptr + ETH_ALEN, pattrib->src, ETH_ALEN); 656 656 if (!bsnaphdr) { 657 - len = htons(len); 658 - memcpy(ptr + 12, &len, 2); 657 + __be16 be_tmp = htons(len); 658 + 659 + memcpy(ptr + 12, &be_tmp, 2); 659 660 } 660 661 return _SUCCESS; 661 662 }