diff options
author | Jacob Kiefer <jtk54@cornell.edu> | 2015-08-09 22:20:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-15 04:44:45 +0300 |
commit | 772a6e1fff9a8c942e982598632cfc41451e2e9a (patch) | |
tree | f3ded885a22ec078cd3e409ab6ff3e2667b6c2a5 /drivers/staging/rtl8723au | |
parent | 071c19e73b605086a26d83ff911cdc6e6af0b3b8 (diff) | |
download | linux-772a6e1fff9a8c942e982598632cfc41451e2e9a.tar.xz |
staging: rtl8723au: Fix Sparse errors in rtw_security.c
This patch fixes the following sparse errors:
CHECK drivers/staging/rtl8723au/core/rtw_security.c
drivers/staging/rtl8723au/core/rtw_security.c:189:39: \
warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:189:39: \
expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:189:39: \
got restricted __le32 [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:197:39: \
warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:197:39: \
expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:197:39: \
got restricted __le32 [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:682:39: \
warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:682:39: \
expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:682:39: \
got restricted __le32 [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:694:39: \
warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:694:39: \
expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:694:39: \
got restricted __le32 [usertype] <noident>
Signed-off-by: Jacob Kiefer <jtk54@cornell.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723au')
-rw-r--r-- | drivers/staging/rtl8723au/core/rtw_security.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_security.c b/drivers/staging/rtl8723au/core/rtw_security.c index af53c92fc3a2..3d40bab1d9c8 100644 --- a/drivers/staging/rtl8723au/core/rtw_security.c +++ b/drivers/staging/rtl8723au/core/rtw_security.c @@ -148,7 +148,7 @@ void rtw_wep_encrypt23a(struct rtw_adapter *padapter, struct xmit_frame *pxmitframe) { /* exclude ICV */ - unsigned char crc[4]; + __le32 crc; struct arc4context mycontext; int curfragnum, length, index; u32 keylength; @@ -186,18 +186,20 @@ void rtw_wep_encrypt23a(struct rtw_adapter *padapter, length = pattrib->last_txcmdsz - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; - *((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); + crc = cpu_to_le32(getcrc32(payload, length)); arcfour_init(&mycontext, wepkey, 3 + keylength); arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload + length, crc, 4); + arcfour_encrypt(&mycontext, payload + length, + (char *)&crc, 4); } else { length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; - *((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); + crc = cpu_to_le32(getcrc32(payload, length)); arcfour_init(&mycontext, wepkey, 3 + keylength); arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload + length, crc, 4); + arcfour_encrypt(&mycontext, payload + length, + (char *)&crc, 4); pframe += pxmitpriv->frag_len; pframe = PTR_ALIGN(pframe, 4); @@ -602,7 +604,7 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter, u32 pnh; u8 rc4key[16]; u8 ttkey[16]; - u8 crc[4]; + __le32 crc; u8 hw_hdr_offset = 0; struct arc4context mycontext; int curfragnum, length; @@ -679,11 +681,12 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter, "pattrib->iv_len =%x, pattrib->icv_len =%x\n", pattrib->iv_len, pattrib->icv_len); - *((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); + crc = cpu_to_le32(getcrc32(payload, length)); arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload + length, crc, 4); + arcfour_encrypt(&mycontext, payload + length, + (char *)&crc, 4); } else { length = (pxmitpriv->frag_len - @@ -691,10 +694,11 @@ int rtw_tkip_encrypt23a(struct rtw_adapter *padapter, pattrib->iv_len - pattrib->icv_len); - *((u32 *)crc) = cpu_to_le32(getcrc32(payload, length)); + crc = cpu_to_le32(getcrc32(payload, length)); arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload + length, crc, 4); + arcfour_encrypt(&mycontext, payload + length, + (char *)&crc, 4); pframe += pxmitpriv->frag_len; pframe = PTR_ALIGN(pframe, 4); |