aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2017-02-10 21:30:28 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-12 13:26:55 +0100
commit43d60f9b7fdeb0bb8e102760a236b428d8e2e4f4 (patch)
treed607c6a18089a274ba729d3a0600d6f603d09667 /drivers/staging
parentstaging: r8712u: Fix Sparse warning in rtl871x_xmit.c (diff)
downloadlinux-dev-43d60f9b7fdeb0bb8e102760a236b428d8e2e4f4.tar.xz
linux-dev-43d60f9b7fdeb0bb8e102760a236b428d8e2e4f4.zip
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8712/rtl871x_recv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
index 147b75beea73..2ef31a4e9a6b 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -654,8 +654,9 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe)
memcpy(ptr, pattrib->dst, ETH_ALEN);
memcpy(ptr + ETH_ALEN, pattrib->src, ETH_ALEN);
if (!bsnaphdr) {
- len = htons(len);
- memcpy(ptr + 12, &len, 2);
+ __be16 be_tmp = htons(len);
+
+ memcpy(ptr + 12, &be_tmp, 2);
}
return _SUCCESS;
}