From dd9161483f420c2ead89f8514956b7717d4ea504 Mon Sep 17 00:00:00 2001 From: Jannik Becher Date: Tue, 20 Dec 2016 18:59:41 +0100 Subject: staging: rtl8712: casted variables to __le32 Fixed a sparse warning. Casting __le32 variables to the right type. Signed-off-by: Jannik Becher Tested-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c index a7f04a4b089d..3400e49c6ce4 100644 --- a/drivers/staging/rtl8712/rtl871x_security.c +++ b/drivers/staging/rtl8712/rtl871x_security.c @@ -192,7 +192,7 @@ void r8712_wep_encrypt(struct _adapter *padapter, u8 *pxmitframe) length = pattrib->last_txcmdsz - pattrib-> hdrlen - pattrib->iv_len - pattrib->icv_len; - *((u32 *)crc) = cpu_to_le32(getcrc32( + *((__le32 *)crc) = cpu_to_le32(getcrc32( payload, length)); arcfour_init(&mycontext, wepkey, 3 + keylength); arcfour_encrypt(&mycontext, payload, payload, @@ -203,7 +203,7 @@ void r8712_wep_encrypt(struct _adapter *padapter, u8 *pxmitframe) length = pxmitpriv->frag_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; - *((u32 *)crc) = cpu_to_le32(getcrc32( + *((__le32 *)crc) = cpu_to_le32(getcrc32( payload, length)); arcfour_init(&mycontext, wepkey, 3 + keylength); arcfour_encrypt(&mycontext, payload, payload, @@ -248,7 +248,7 @@ void r8712_wep_decrypt(struct _adapter *padapter, u8 *precvframe) arcfour_init(&mycontext, wepkey, 3 + keylength); arcfour_encrypt(&mycontext, payload, payload, length); /* calculate icv and compare the icv */ - *((u32 *)crc) = cpu_to_le32(getcrc32(payload, length - 4)); + *((__le32 *)crc) = cpu_to_le32(getcrc32(payload, length - 4)); } } @@ -616,7 +616,7 @@ u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe) pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; - *((u32 *)crc) = cpu_to_le32( + *((__le32 *)crc) = cpu_to_le32( getcrc32(payload, length)); arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, @@ -628,7 +628,7 @@ u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe) pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len; - *((u32 *)crc) = cpu_to_le32(getcrc32( + *((__le32 *)crc) = cpu_to_le32(getcrc32( payload, length)); arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, @@ -696,7 +696,7 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe) /* 4 decrypt payload include icv */ arcfour_init(&mycontext, rc4key, 16); arcfour_encrypt(&mycontext, payload, payload, length); - *((u32 *)crc) = cpu_to_le32(getcrc32(payload, + *((__le32 *)crc) = cpu_to_le32(getcrc32(payload, length - 4)); if (crc[3] != payload[length - 1] || crc[2] != payload[length - 2] || -- cgit v1.2.3