staging: rtl8723bs: Fix some white-space errors in core/rtw_security.c
Smatch reports the following: CHECK drivers/staging/rtl8723bs/core/rtw_security.c drivers/staging/rtl8723bs/core/rtw_security.c:266 rtw_wep_encrypt() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:433 rtw_seccalctkipmic() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:749 rtw_tkip_encrypt() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:865 rtw_tkip_decrypt() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:1383 aes_cipher() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:1415 aes_cipher() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:1430 aes_cipher() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:1582 rtw_aes_encrypt() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:1651 aes_decipher() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:1739 aes_decipher() warn: inconsistent indenting drivers/staging/rtl8723bs/core/rtw_security.c:1792 aes_decipher() warn: curly braces intended? drivers/staging/rtl8723bs/core/rtw_security.c:1809 aes_decipher() warn: inconsistent indenting All of the above are fixed with white-space changes. A few unneeded blank lines are deleted. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
aa29d8bca5
Коммит
0ba8d4b959
|
@ -270,9 +270,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
|
|||
|
||||
pframe += pxmitpriv->frag_len;
|
||||
pframe = (u8 *)RND4((SIZE_PTR)(pframe));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
WEP_SW_ENC_CNT_INC(psecuritypriv, pattrib->ra);
|
||||
|
@ -748,7 +746,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
|
|||
|
||||
pframe += pxmitpriv->frag_len;
|
||||
pframe = (u8 *)RND4((SIZE_PTR)(pframe));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -791,10 +788,8 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
|
|||
|
||||
/* 4 start to decrypt recvframe */
|
||||
if (prxattrib->encrypt == _TKIP_) {
|
||||
|
||||
stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
|
||||
if (stainfo != NULL) {
|
||||
|
||||
if (IS_MCAST(prxattrib->ra)) {
|
||||
static unsigned long start = 0;
|
||||
static u32 no_gkey_bc_cnt = 0;
|
||||
|
@ -860,7 +855,8 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
|
|||
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length-4));
|
||||
|
||||
if (crc[3] != payload[length-1] || crc[2] != payload[length-2] || crc[1] != payload[length-3] || crc[0] != payload[length-4]) {
|
||||
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
|
||||
RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
|
||||
("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
|
||||
crc[3], payload[length-1], crc[2], payload[length-2], crc[1], payload[length-3], crc[0], payload[length-4]));
|
||||
res = _FAIL;
|
||||
}
|
||||
|
@ -1375,8 +1371,7 @@ static sint aes_cipher(u8 *key, uint hdrlen,
|
|||
else
|
||||
a4_exists = 1;
|
||||
|
||||
if (
|
||||
((frtype|frsubtype) == WIFI_DATA_CFACK) ||
|
||||
if (((frtype|frsubtype) == WIFI_DATA_CFACK) ||
|
||||
((frtype|frsubtype) == WIFI_DATA_CFPOLL) ||
|
||||
((frtype|frsubtype) == WIFI_DATA_CFACKPOLL)) {
|
||||
qc_exists = 1;
|
||||
|
@ -1497,9 +1492,9 @@ static sint aes_cipher(u8 *key, uint hdrlen,
|
|||
|
||||
for (j = 0; j < 16; j++)
|
||||
padded_buffer[j] = 0x00;
|
||||
for (j = 0; j < payload_remainder; j++) {
|
||||
for (j = 0; j < payload_remainder; j++)
|
||||
padded_buffer[j] = pframe[payload_index+j];/* padded_buffer[j] = message[payload_index+j]; */
|
||||
}
|
||||
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
||||
for (j = 0; j < payload_remainder; j++)
|
||||
|
@ -1519,9 +1514,8 @@ static sint aes_cipher(u8 *key, uint hdrlen,
|
|||
|
||||
for (j = 0; j < 16; j++)
|
||||
padded_buffer[j] = 0x00;
|
||||
for (j = 0; j < 8; j++) {
|
||||
for (j = 0; j < 8; j++)
|
||||
padded_buffer[j] = pframe[j+hdrlen+8+plen];/* padded_buffer[j] = message[j+hdrlen+8+plen]; */
|
||||
}
|
||||
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
||||
|
@ -1570,7 +1564,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
|
|||
prwskeylen = 16;
|
||||
|
||||
for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
|
||||
|
||||
if ((curfragnum+1) == pattrib->nr_frags) { /* 4 the last fragment */
|
||||
length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
|
||||
|
||||
|
@ -1581,7 +1574,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
|
|||
aes_cipher(prwskey, pattrib->hdrlen, pframe, length);
|
||||
pframe += pxmitpriv->frag_len;
|
||||
pframe = (u8 *)RND4((SIZE_PTR)(pframe));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1643,13 +1635,11 @@ static sint aes_decipher(u8 *key, uint hdrlen,
|
|||
else
|
||||
a4_exists = 1;
|
||||
|
||||
if (
|
||||
((frtype|frsubtype) == WIFI_DATA_CFACK) ||
|
||||
if (((frtype|frsubtype) == WIFI_DATA_CFACK) ||
|
||||
((frtype|frsubtype) == WIFI_DATA_CFPOLL) ||
|
||||
((frtype|frsubtype) == WIFI_DATA_CFACKPOLL)) {
|
||||
qc_exists = 1;
|
||||
if (hdrlen != WLAN_HDR_A3_QOS_LEN) {
|
||||
|
||||
hdrlen += 2;
|
||||
}
|
||||
} else if ((frtype == WIFI_DATA) && /* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
|
@ -1658,7 +1648,6 @@ static sint aes_decipher(u8 *key, uint hdrlen,
|
|||
(frsubtype == 0x0a) ||
|
||||
(frsubtype == 0x0b))) {
|
||||
if (hdrlen != WLAN_HDR_A3_QOS_LEN) {
|
||||
|
||||
hdrlen += 2;
|
||||
}
|
||||
qc_exists = 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче