diff options
author | Fabio Aiuto <fabioaiuto83@gmail.com> | 2021-04-15 13:07:19 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-22 11:39:51 +0300 |
commit | 79df841b4350189e883c7db91d0fe495e087259e (patch) | |
tree | f9cff8c737fad46b2a441c757630363f73d7a4ea /drivers/staging/rtl8723bs/core/rtw_security.c | |
parent | 5cc83644945818c00eb5a6e69cf8fba730c92a38 (diff) | |
download | linux-79df841b4350189e883c7db91d0fe495e087259e.tar.xz |
staging: rtl8723bs: replace DBG_871X_LEVEL logs with netdev_*()
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>
Diffstat (limited to 'drivers/staging/rtl8723bs/core/rtw_security.c')
-rw-r--r-- | drivers/staging/rtl8723bs/core/rtw_security.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c index 9587d89a6b24..7823055ed32d 100644 --- a/drivers/staging/rtl8723bs/core/rtw_security.c +++ b/drivers/staging/rtl8723bs/core/rtw_security.c @@ -684,8 +684,11 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) if (jiffies_to_msecs(jiffies - start) > 1000) { if (no_gkey_bc_cnt || no_gkey_mc_cnt) { - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", - FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); + netdev_dbg(padapter->pnetdev, + FUNC_ADPT_FMT " no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", + FUNC_ADPT_ARG(padapter), + no_gkey_bc_cnt, + no_gkey_mc_cnt); } start = jiffies; no_gkey_bc_cnt = 0; @@ -695,8 +698,11 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) } if (no_gkey_bc_cnt || no_gkey_mc_cnt) { - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" gkey installed. no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", - FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); + netdev_dbg(padapter->pnetdev, + FUNC_ADPT_FMT " gkey installed. no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", + FUNC_ADPT_ARG(padapter), + no_gkey_bc_cnt, + no_gkey_mc_cnt); } start = 0; no_gkey_bc_cnt = 0; @@ -1631,8 +1637,11 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) if (jiffies_to_msecs(jiffies - start) > 1000) { if (no_gkey_bc_cnt || no_gkey_mc_cnt) { - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", - FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); + netdev_dbg(padapter->pnetdev, + FUNC_ADPT_FMT " no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", + FUNC_ADPT_ARG(padapter), + no_gkey_bc_cnt, + no_gkey_mc_cnt); } start = jiffies; no_gkey_bc_cnt = 0; @@ -1643,8 +1652,11 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) } if (no_gkey_bc_cnt || no_gkey_mc_cnt) { - DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" gkey installed. no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", - FUNC_ADPT_ARG(padapter), no_gkey_bc_cnt, no_gkey_mc_cnt); + netdev_dbg(padapter->pnetdev, + FUNC_ADPT_FMT " gkey installed. no_gkey_bc_cnt:%u, no_gkey_mc_cnt:%u\n", + FUNC_ADPT_ARG(padapter), + no_gkey_bc_cnt, + no_gkey_mc_cnt); } start = 0; no_gkey_bc_cnt = 0; @@ -2149,13 +2161,17 @@ u8 rtw_handle_tkip_countermeasure(struct adapter *adapter, const char *caller) unsigned long passing_ms = jiffies_to_msecs(jiffies - securitypriv->btkip_countermeasure_time); if (passing_ms > 60*1000) { - DBG_871X_LEVEL(_drv_always_, "%s(%s) countermeasure time:%lus > 60s\n", - caller, ADPT_ARG(adapter), passing_ms/1000); + netdev_dbg(adapter->pnetdev, + "%s(%s) countermeasure time:%lus > 60s\n", + caller, ADPT_ARG(adapter), + passing_ms / 1000); securitypriv->btkip_countermeasure = false; securitypriv->btkip_countermeasure_time = 0; } else { - DBG_871X_LEVEL(_drv_always_, "%s(%s) countermeasure time:%lus < 60s\n", - caller, ADPT_ARG(adapter), passing_ms/1000); + netdev_dbg(adapter->pnetdev, + "%s(%s) countermeasure time:%lus < 60s\n", + caller, ADPT_ARG(adapter), + passing_ms / 1000); status = _FAIL; } } |