summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8723bs/core/rtw_security.c
AgeCommit message (Collapse)AuthorFilesLines
2021-09-13staging: rtl8723bs: clean up comparsions to NULLMichael Straube1-3/+3
Clean up comparsions to NULL reported by checkpatch. x == NULL -> !x x != NULL -> x Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210829154533.11054-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-05staging: rtl8723bs: remove unused macrosFabio Aiuto1-5/+0
remove unused macros detected by -Wunused-macros gcc option. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/20210801134629.23433-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-28staging: rtl8723bs: core: Fix incorrect type in assignmentFabio M. De Francesco1-13/+18
Fix sparse warnings: incorrect type in assignment (different base types). Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210728091117.6235-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-25staging: rtl8723bs: moved contexts for arc4 encryption in struct security_privFabio Aiuto1-21/+20
moved struct arc4_ctx in struct security_priv to avoid stack allocation inside encryption routines. this has been done to fix the following 0-DAY issues: >> drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt' [-Wframe-$ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) ^ >> drivers/staging/rtl8723bs/core/rtw_security.c:145:6: warning: stack frame size of 1088 bytes in function 'rtw_wep_decrypt' [-Wframe$ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) ^ >> drivers/staging/rtl8723bs/core/rtw_security.c:514:5: warning: stack frame size of 1136 bytes in function 'rtw_tkip_encrypt' [-Wfram$ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) ^ >> drivers/staging/rtl8723bs/core/rtw_security.c:586:5: warning: stack frame size of 1104 bytes in function 'rtw_tkip_decrypt' [-Wfram$ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) ^ Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/20210521144158.2440-1-fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-13staging: rtl8723bs: remove unneeded comments to silence 'line too long' warningFabio Aiuto1-2/+3
remove unneeded comments to fix the following post commit hook checkpatch warnings: WARNING: line length of 110 exceeds 100 columns 115: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:510: + *((__le32 *)crc) = ~crc32_le(~0, payload, length);/* modified by Amy*/ WARNING: line length of 110 exceeds 100 columns 124: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:518: + *((__le32 *)crc) = ~crc32_le(~0, payload, length);/* modified by Amy*/ Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/bb479715e3603ab78863576783dbbf49c5f6f703.1620652505.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-13staging: rtl8723bs: replace private CRC-32 routines with in-kernel onesFabio Aiuto1-59/+7
replace private CRC-32 routines with in-kernel ones. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/cdd9bc521b7119a9c2787b46109eb76f94bd295a.1620652505.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8723bs: replace private arc4 encryption with in-kernel oneFabio Aiuto1-80/+21
replace private arc4 encryption with in-kernel one. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/af960dc728f039d64f4fb28fcece3ca92d24fbe4.1620372584.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8723bs: remove unused macros, arrays and an inline function defFabio Aiuto1-175/+0
remove unused macros, arrays and a function definition. Many of these facilities were used in removed private aes encryption. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/ada64bfc622dbfe6d4ff03c46dff48b25ebc641e.1620372584.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8723bs: use in-kernel aes encryptionFabio Aiuto1-207/+5
replace private aes encryption subroutines with public in-kernel ones in data frame encryption. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/bd1f47994d3a1d0f434de5b2095c327f5a25f6ef.1620139727.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8723bs: use in-kernel aes encryption in OMAC1 routinesFabio Aiuto1-105/+9
replace private aes encryption subroutines with public in-kernel ones in OMAC1 computation routines. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/11ac26487aab92ded28747c1f0cb42a94183130d.1620139727.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8723bs: align argument position in a new lineFabio Aiuto1-1/+1
align function arguments position on a new line to open parentheses. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/f195bc7d72c122e5e16b3857cf99ae1f84734915.1620139727.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8723bs: remove debug macros related to core/rtw_security.c tracingFabio Aiuto1-2/+0
remove debug macro definitions related to core/rtw_security.c obsolete tracing. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/510d1f1223156d1b613c6562aeaf86385734214c.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-10staging: rtl8723bs: core: rtw_security: Demote non-conformant kernel-doc headerLee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): from drivers/staging/rtl8188eu/core/rtw_security.c:10: drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'p1k' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'tk' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'ta' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'rc4key' not described in 'phase2' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'tk' not described in 'phase2' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'p1k' not described in 'phase2' drivers/staging/rtl8723bs/core/rtw_security.c:1937: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20210414181129.1628598-16-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-22staging: rtl8723bs: replace DBG_871X_LEVEL logs with netdev_*()Fabio Aiuto1-12/+28
Replace DBG_871X_LEVEL logs with netdev_*() functions where possible (i.e. where a pointer to netdev is easily available). This is not possible in correspondance of redundant log in module initialization. So remove those ones. DBG_871X_LEVEL macro wraps a raw printk call which is not recommended in a device driver context, prefer using netdev_*() log functions. The remove/replace operation has been done with the following semantic patch script: @@ expression list args; identifier padapter; identifier func; symbol _drv_always_, _drv_info_, _drv_warning_; symbol _drv_err_, _drv_emerg_; @@ func(..., struct adapter *padapter, ...) { <... ( - DBG_871X_LEVEL(_drv_always_, args); + netdev_dbg(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_info_, args); + netdev_info(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_warning_, args); + netdev_warn(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_err_, args); + netdev_err(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_emerg_, args); + netdev_emerg(padapter->pnetdev, args); ) ...> } @rule@ identifier func, context, padapter; @@ func(void *context) { ... struct adapter *padapter = context; ... } @@ expression list args; identifier rule.padapter; identifier rule.func, rule.context; @@ func(void *context) { <... ( - DBG_871X_LEVEL(_drv_always_, args); + netdev_dbg(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_info_, args); + netdev_info(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_warning_, args); + netdev_warn(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_err_, args); + netdev_err(padapter->pnetdev, args); | - DBG_871X_LEVEL(_drv_emerg_, args); + netdev_emerg(padapter->pnetdev, args); ) ...> } @@ expression list args; expression get_dev; identifier func, dev; @@ func(...) { ... struct net_device *dev = get_dev; <... ( - DBG_871X_LEVEL(_drv_always_, args); + netdev_dbg(dev, args); | - DBG_871X_LEVEL(_drv_info_, args); + netdev_info(dev, args); | - DBG_871X_LEVEL(_drv_warning_, args); + netdev_warn(dev, args); | - DBG_871X_LEVEL(_drv_err_, args); + netdev_err(dev, args); | - DBG_871X_LEVEL(_drv_emerg_, args); + netdev_emerg(dev, args); ) ...> } @@ expression list args; identifier func, dev; @@ func(struct net_device *dev) { <... ( - DBG_871X_LEVEL(_drv_always_, args); + netdev_dbg(dev, args); | - DBG_871X_LEVEL(_drv_info_, args); + netdev_info(dev, args); | - DBG_871X_LEVEL(_drv_warning_, args); + netdev_warn(dev, args); | - DBG_871X_LEVEL(_drv_err_, args); + netdev_err(dev, args); | - DBG_871X_LEVEL(_drv_emerg_, args); + netdev_emerg(dev, args); ) ...> } @@ expression list args; identifier func, dvobj; @@ func(struct dvobj_priv *dvobj) { <... ( - DBG_871X_LEVEL(_drv_always_, args); + netdev_dbg(dvobj->if1->pnetdev, args); | - DBG_871X_LEVEL(_drv_info_, args); + netdev_info(dvobj->if1->pnetdev, args); | - DBG_871X_LEVEL(_drv_warning_, args); + netdev_warn(dvobj->if1->pnetdev, args); | - DBG_871X_LEVEL(_drv_err_, args); + netdev_err(dvobj->if1->pnetdev, args); | - DBG_871X_LEVEL(_drv_emerg_, args); + netdev_emerg(dvobj->if1->pnetdev, args); ) ...> } @@ @@ - DBG_871X_LEVEL(...); Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/4a02f9f5665fa4b78c0b321ce0cc62254255c9dd.1618480688.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rtl8723bs: rewrite comparison to nullFabio Aiuto1-1/+1
fi following post-commit checkpatch issues: CHECK: Comparison to NULL could be written "!p" 290: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:978: + if (p == NULL) -- CHECK: Comparison to NULL could be written "!pmgntframe" 328: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2016: + if (pmgntframe == NULL) -- CHECK: Comparison to NULL could be written "!pmgntframe" 361: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2378: + if (pmgntframe == NULL) -- CHECK: Comparison to NULL could be written "!pmgntframe" 391: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3478: + if (pmgntframe == NULL) -- CHECK: Comparison to NULL could be written "!p" 427: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4071: + if (p == NULL) -- CHECK: Comparison to NULL could be written "!BIP_AAD" 781: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1690: + if (BIP_AAD == NULL) -- CHECK: Comparison to NULL could be written "!pwep" 1773: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3062: + if (pwep == NULL) -- CHECK: Comparison to NULL could be written "!pmlmepriv->wps_beacon_ie" 1784: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3510: + if (pmlmepriv->wps_beacon_ie == NULL) -- CHECK: Comparison to NULL could be written "!pmlmepriv->wps_probe_resp_ie" 1795: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3544: + if (pmlmepriv->wps_probe_resp_ie == NULL) -- CHECK: Comparison to NULL could be written "!pmlmepriv->wps_assoc_resp_ie" 1807: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3574: + if (pmlmepriv->wps_assoc_resp_ie == NULL) -- CHECK: Comparison to NULL could be written "!pbuf" 1818: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3928: + if (pbuf == NULL) -- CHECK: Comparison to NULL could be written "!if1" 1944: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:392: + if (if1 == NULL) CHECK: Using comparison to false is error prone 402: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3890: + if (false == bxmitok) -- CHECK: Using comparison to true is error prone 671: FILE: drivers/staging/rtl8723bs/core/rtw_recv.c:365: + if ((prxattrib->bdecrypted == true) && (brpt_micerror == true)) -- CHECK: Using comparison to true is error prone 1051: FILE: drivers/staging/rtl8723bs/core/rtw_xmit.c:1174: + if (padapter->securitypriv.binstallBIPkey != true) -- CHECK: Using comparison to false is error prone 1632: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2194: + if (false == bMatched) Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/572f96dcb6217fd3e6ea23c37b55b0ebb3231f14.1617802415.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rtl8723bs: add spaces around operatorsFabio Aiuto1-1/+1
fix the following post-commit checkpatch issues: CHECK: spaces preferred around that '|' (ctx:VxV) 187: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:1659: + if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) -- CHECK: spaces preferred around that '|' (ctx:VxV) 373: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3023: + == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK)) -- CHECK: spaces preferred around that '-' (ctx:VxV) 456: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4098: + if (len > (NDIS_802_11_LENGTH_RATES_EX-i)) -- CHECK: spaces preferred around that '+' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '+' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '-' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '+' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '+' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '+' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '-' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '+' (ctx:VxV) 770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590: + if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) -- CHECK: spaces preferred around that '-' (ctx:VxV) 1001: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1849: + if (i > (NUM_STA-1)) -- CHECK: spaces preferred around that '&' (ctx:VxV) 1647: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:211: + if (mcs_rate&0x8000) /* MCS15 */ Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/28885311d4351d4df4508a50765a9b92a2b8da77.1617802415.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rtl8723bs: remove unnecessary bracks on DBG_871X removal sitesFabio Aiuto1-8/+7
remove unnecessary bracks on DBG_871X removal sites Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/35f5edf0f39b717b3de3ad7861cbaa5f4ba60576.1617802415.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-07staging: rtl8723bs: remove all DBG_871X logsFabio Aiuto1-11/+0
Remove all of the DBG_871X logs as they currently do nothing as they require the code to be modified by hand in order to be turned on. This obviously has not happened since the code was merged, so just remove them as they are unused. applied the following semantic patch script: @@ expression a, b, c, d, e, f, g, h, i, j, k; constant B, C, D, E; @@ ( - DBG_871X(a); | - DBG_871X(a, b); | - DBG_871X(a, B); | - DBG_871X(a, b, c); | - DBG_871X(a, B, c); | - DBG_871X(a, b, C); | - DBG_871X(a, B, C); | - DBG_871X(a, b, c, d); | - DBG_871X(a, B, c, d); | - DBG_871X(a, b, C, d); | - DBG_871X(a, b, c, D); | - DBG_871X(a, B, C, d); | - DBG_871X(a, B, c, D); | - DBG_871X(a, b, C, D); | - DBG_871X(a, B, C, D); | - DBG_871X(a, b, c, d, e); | - DBG_871X(a, B, c, d, e); | - DBG_871X(a, b, C, d, e); | - DBG_871X(a, b, c, D, e); | - DBG_871X(a, b, c, d, E); | - DBG_871X(a, B, C, d, e); | - DBG_871X(a, B, c, D, e); | - DBG_871X(a, B, c, d, E); | - DBG_871X(a, b, C, D, e); | - DBG_871X(a, b, C, d, E); | - DBG_871X(a, b, c, D, E); | - DBG_871X(a, B, C, D, e); | - DBG_871X(a, B, C, d, E); | - DBG_871X(a, B, c, D, E); | - DBG_871X(a, b, C, D, E); | - DBG_871X(a, B, C, D, E); | - DBG_871X(a, b, c, d, e, f); | - DBG_871X(a, b, c, d, e, f, g); | - DBG_871X(a, b, c, d, e, f, g, h); | - DBG_871X(a, b, c, d, e, f, g, h, i); | - DBG_871X(a, b, c, d, e, f, g, h, i, j); | - DBG_871X(a, b, c, d, e, f, g, h, i, j, k); ) Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/89a39f551107ba73b44dd2422765cf8ce371501a.1617802415.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-05staging: rtl8723bs: fix spaces around operator issues in core/rtw_security.cFabio Aiuto1-2/+2
fix the following post commit hook checkpatch issues: CHECK: spaces preferred around that '-' (ctx:VxV) 25: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:729: + if (crc[3] != payload[length-1] || crc[2] != payload[length-2] || ^ CHECK: spaces preferred around that '-' (ctx:VxV) 25: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:729: + if (crc[3] != payload[length-1] || crc[2] != payload[length-2] || ^ CHECK: spaces preferred around that '-' (ctx:VxV) 26: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:730: + crc[1] != payload[length-3] || crc[0] != payload[length-4]) ^ CHECK: spaces preferred around that '-' (ctx:VxV) 26: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:730: + crc[1] != payload[length-3] || crc[0] != payload[length-4]) ^ Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/9143a02ae6959d4deae6c22bdba42041bf6484a2.1617545239.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-05staging: rtl8723bs: fix line exceed warning in core/rtw_security.cFabio Aiuto1-1/+2
fix the following post-commit hook checkpatch issue: WARNING: line length of 149 exceeds 100 columns 61: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:729: + if (crc[3] != payload[length-1] || crc[2] != payload[length-2] || crc[1] != payload[length-3] || crc[0] != payload[length-4]) Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/862862a3e309209e2508de0c9a1b5a02ce1312b2.1617545239.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-05staging: rtl8723bs: remove RT_TRACE logs in core/rtw_security.cFabio Aiuto1-39/+1
Remove all of the RT_TRACE logs in the core/rtw_security.c file as they currently do nothing as they require the code to be modified by hand in order to be turned on. This obviously has not happened since the code was merged. Moreover it relies on an unneeded private log level tracing which overrides the in-kernel public one, so just remove them as they are unused. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/14207c2b7ea789e8b0f3bd37d2758e979eff997c.1617545239.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-28staging: rtl8723bs: include macro in a do - while loop in core/rtw_security.cFabio Aiuto1-4/+6
fix the following checkpatch warning: ERROR: Macros with multiple statements should be enclosed in a do - while loop 2014: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:2014: +#define ROUND(i, d, s) \ Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/0f176b08b7a49d6649ff9d5468bd912e58c1db06.1616854134.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-28staging: rtl8723bs: remove macros updating unused fields in struct security_privFabio Aiuto1-68/+0
remove macros updating statistic fields in struct security_priv Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/00c13a16f0034884a916855a7b7d782d6d05d4c1.1616854134.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-18staging: rtl8723bs/core: add spaces between operatorsQiang Ma1-3/+3
Add spaces between operators for a better readability in function 'rtw_seccalctkipmic'. Signed-off-by: Qiang Ma <maqianga@uniontech.com> Link: https://lore.kernel.org/r/20210316120500.351-1-maqianga@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16staging: rtl8723bs: add spaces between operatorsQiang Ma1-1/+1
Add spaces between operators for a better readability in function 'rtw_secgetmic'. Signed-off-by: Qiang Ma <maqianga@uniontech.com> Link: https://lore.kernel.org/r/20210315030813.19445-1-maqianga@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16Staging: rtl8723bs/core: fix space coding style issueQiang Ma1-1/+1
Add one space around (on each side of) '*' binary operators. Signed-off-by: Qiang Ma <maqianga@uniontech.com> Link: https://lore.kernel.org/r/20210315015659.2402-1-maqianga@uniontech.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-12staging: rtl8723bs: remove typedefs in basic_types.hMarco Cesati1-44/+44
This commit fixes the following checkpatch.pl warning: WARNING: do not add new typedefs #16: FILE: include/basic_types.h:16: +typedef signed int sint; Signed-off-by: Marco Cesati <marco.cesati@gmail.com> Link: https://lore.kernel.org/r/20210312082638.25512-28-marco.cesati@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28Staging: rtl8723bs/core: fix braces coding style issuesBrother Matthew De Angelis1-16/+8
Fix all the braces coding style issues found by checkpatch.pl in rtw_security.c. Signed-off-by: Brother Matthew De Angelis <matthew.v.deangelis@gmail.com> Link: https://lore.kernel.org/r/20201211222845.GA543167@a Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-08staging: rtl8723bs: replace _MME_IE_Ross Schmidt1-1/+1
Replace unique _MME_IE_ macro with kernel provided WLAN_EID_MMIE from linux/ieee80211.h. Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201208040733.379197-17-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-13staging: rtl8723bs: clean up open ended linesRoss Schmidt1-173/+88
Move declarations to fix coding style issues and clear checkpatch checks. CHECK: Lines should not end with a '(' Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201110041008.15847-4-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-13staging: rtl8723bs: clean up space before tabsRoss Schmidt1-22/+22
Remove spaces before tabs to fix coding style issues and clear checkpatch warnings. WARNING: please, no space before tabs Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201110041008.15847-3-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-13staging: rtl8723bs: clean up bracesRoss Schmidt1-19/+23
Add or remove braces or remove lines to fix coding style issues and clear checkpatch. WARNING: braces {} are not necessary for single statement blocks WARNING: braces {} are not necessary for any arm of this statement CHECK: Unbalanced braces around else statement CHECK: braces {} should be used on all arms of this statement CHECK: Blank lines aren't necessary before a close brace '}' CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201110041008.15847-2-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-13staging: rtl8723bs: clean up line spacingRoss Schmidt1-24/+5
Add or remove lines to fix coding style issues and clear checkpatch. WARNING: Missing a blank line after declarations CHECK: Please use a blank line after function/struct/union/enum declarations CHECK: Please don't use multiple blank lines Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201110041008.15847-1-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-06staging: rtl8723bs: remove ADPT_FMT macroRoss Schmidt1-2/+2
Remove unnecessary macro for %s and call it directly. Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201105034754.12383-5-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-27staging: rtl8723bs: Rewrite comparison to NULLIzabela Bakollari1-2/+2
Rewrite comparison to NULL by modifying (p != NULL) to (p). Issue reported by checkpatch. Signed-off-by: Izabela Bakollari <izabela.bakollari@gmail.com> Link: https://lore.kernel.org/r/20201026232310.48128-1-izabela.bakollari@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-05staging: rtl8723bs: replace RND4 with round_up()Ross Schmidt1-3/+3
Use round_up instead of define RND4. Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com> Link: https://lore.kernel.org/r/20201004011743.10750-1-ross.schm.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07mm, treewide: rename kzfree() to kfree_sensitive()Waiman Long1-1/+1
As said by Linus: A symmetric naming is only helpful if it implies symmetries in use. Otherwise it's actively misleading. In "kzalloc()", the z is meaningful and an important part of what the caller wants. In "kzfree()", the z is actively detrimental, because maybe in the future we really _might_ want to use that "memfill(0xdeadbeef)" or something. The "zero" part of the interface isn't even _relevant_. The main reason that kzfree() exists is to clear sensitive information that should not be leaked to other future users of the same memory objects. Rename kzfree() to kfree_sensitive() to follow the example of the recently added kvfree_sensitive() and make the intention of the API more explicit. In addition, memzero_explicit() is used to clear the memory to make sure that it won't get optimized away by the compiler. The renaming is done by using the command sequence: git grep -w --name-only kzfree |\ xargs sed -i 's/kzfree/kfree_sensitive/' followed by some editing of the kfree_sensitive() kerneldoc and adding a kzfree backward compatibility macro in slab.h. [akpm@linux-foundation.org: fs/crypto/inline_crypt.c needs linux/slab.h] [akpm@linux-foundation.org: fix fs/crypto/inline_crypt.c some more] Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Cc: James Morris <jmorris@namei.org> Cc: "Serge E. Hallyn" <serge@hallyn.com> Cc: Joe Perches <joe@perches.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: David Rientjes <rientjes@google.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: "Jason A . Donenfeld" <Jason@zx2c4.com> Link: http://lkml.kernel.org/r/20200616154311.12314-3-longman@redhat.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-07-17staging: rtl*/security: Use static const in array declarationsJoe Perches1-3/+3
Use static const in declarations where appropriate. Signed-off-by: Joe Perches <joe@perches.com> Link: https://lore.kernel.org/r/818bbd25924f0c733a4a39d426fd30392d4eae80.camel@perches.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-19staging: rtl8723bs: Using comparison to true is error proneJohn Oldman1-3/+3
fix below issue reported by checkpatch CHECK: Using comparison to true is error prone CHECK: Using comparison to false is error prone Signed-off-by: John Oldman <john.oldman@polehill.co.uk> Link: https://lore.kernel.org/r/20200515173108.14739-1-john.oldman@polehill.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25staging: rtl8723bs: Remove blank line before '}' braceSimran Singhal1-8/+0
Remove unneeded blank line before a close brace '}'. Issue found by checkpatch.pl: CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by: Simran Singhal <singhalsimran0@gmail.com> Link: https://lore.kernel.org/r/20200325182617.GA9411@simran-Inspiron-5558 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-15staging: rtl8723bs: fix indentation issueColin Ian King1-5/+5
There is a block of statements that are indented too deeply, remove the extraneous tabs. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20191114095747.132407-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: rtl8723bs: Change tabs for spacesJavier F. Arias1-3/+3
Change tabs for spaces when they are incorrectly used as separators. Fix suggested by Julia Lawall. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/7b06c103665ab7250dded8c5dadc093228eee7b4.1571284318.git.jarias.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: rtl8723bs: Fix function call formatJavier F. Arias1-10/+5
Fix function call format by following the coding style guidelines for argument wrapping in function calls. Issue found by checkpatch. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/828984012f4c58f9d10647511f98005e4d1d5184.1571284318.git.jarias.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: rtl8723bs: Fix indentation warningsJavier F. Arias1-2/+2
Fix indentation warnings to improve the code formatting. Issue found by checkpatch. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/166ffc747a4212f81d26b03883dbc04d64deed56.1571284318.git.jarias.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: rtl8723bs: Remove commented codeJavier F. Arias1-47/+9
Remove commented code for a cleaner file. Issue found by checkpatch. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/61f9b94781eb0ca1c94a5b6b8c37a8c2d0caaca6.1571284318.git.jarias.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: rtl8723bs: Add spaces between operatorsJavier F. Arias1-18/+18
Add spaces between operators for a better readability. Issue found by checkpatch. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/4194f2f5a7ed9deeaf3c2a2f2c91081e1f1189c0.1571284318.git.jarias.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: rtl8723bs: Fix lines over 80 charactersJavier F. Arias1-9/+31
Fix lines over 80 characters by wrapping arguments in function calls, improving the format for a better code readability. Issue found by checkpatch. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/6a12577f3b95a77e060a2fb60ff17ce94774c076.1571284318.git.jarias.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26staging: rtl8723bs: Replace string with identifierJavier F. Arias1-11/+11
Replace the hardcoded function names with the corresponding predefined identifiers. Issue found by checkpatch. Signed-off-by: Javier F. Arias <jarias.linux@gmail.com> Link: https://lore.kernel.org/r/b2ff6a52a7140480c9fdb6486a6ac6b4eb51203b.1571284318.git.jarias.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-07staging: rtl8723bs: Remove set but not used variable 'prwskeylen'zhengbin1-9/+0
Fixes gcc '-Wunused-but-set-variable' warning: drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_encrypt: drivers/staging/rtl8723bs/core/rtw_security.c:660:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_decrypt: drivers/staging/rtl8723bs/core/rtw_security.c:768:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_aes_encrypt: drivers/staging/rtl8723bs/core/rtw_security.c:1528:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable] It is not used since commit 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Link: https://lore.kernel.org/r/1570352999-45790-4-git-send-email-zhengbin13@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30staging: rtl8723bs: remove return statements from void functionsMichael Straube1-1/+0
Remove unnecessary return statements from void functions reported by checkpatch. WARNING: void function return statements are not generally useful Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20190914115634.67874-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>