lkml.org 
[lkml]   [2016]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 04/13] staging: rtl8712: casted variables to __le32
Date
Fixed a sparse warning.
Casting __le32 variables to the right type.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c
index a7f04a4..3400e49 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] ||
--
2.7.4
\
 
 \ /
  Last update: 2016-12-20 19:03    [W:0.067 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site