staging: rtl8723bs: replace DBG_871X_SEL_NL macro with netdev_dbg()
v2 cover staging: rtl8723bs: replace DBG_871X_SEL_NL macro with netdev_dbg()
This patchset replaces DGB_871X_SEL_NL macro with the driver recommended log function netdev_dbg().
Here are contained the patches not accepted yet in v1.
Macro DBG_871X_SEL_NL indeed executes a raw printk call as default behaviour. The other behaviour is doing a seq_printf() call which never occurs.
First patch apply the following coccinelle script for macro bulk replacement:
@@
expression sel;
expression list args;
identifier padapter;
identifier func;
@@
func(..., struct adapter *padapter, ...) {
<...
- DBG_871X_SEL_NL(sel, args);
+ netdev_dbg(padapter->pnetdev, args);
...>
}added by hand a newline in coccinelle output.
Second patch removes DBG_871X_SEL_NL macro declaration. Third patch removes an unused function argument after macro replacement.
-------------------------------------------------
Changes in v2:
- Excluded patches already accepted in v1
- Added by hand a newline after coccinelle script application
- Dropped the patch applying newline separately
Fabio Aiuto (3):
staging: rtl8723bs: replace DBG_871X_SEL_NL with netdev_dbg()
staging: rtl8723bs: remove DBG_871X_SEL_NL macro declaration
staging: rtl8723bs: remove unused argument in function
drivers/staging/rtl8723bs/core/rtw_debug.c | 16 +++--- drivers/staging/rtl8723bs/core/rtw_odm.c | 52 ++++++++++--------- drivers/staging/rtl8723bs/hal/hal_com.c | 31 +++++------ drivers/staging/rtl8723bs/include/rtw_debug.h | 9 ---- drivers/staging/rtl8723bs/include/rtw_odm.h | 2 +- .../staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 6 files changed, 50 insertions(+), 62 deletions(-)
Signature · 1 line
2.20.1
PATCH v2 1/3 staging: rtl8723bs: replace DBG_871X_SEL_NL with netdev_dbg()
replace DGB_871X_SEL_NL macro with netdev_dbg().
DBG_871X_SEL_NL macro expands to a raw prink call or a seq_printf if selected stream _is not_ a local debug symbol set to null.
This second scenario never occurs so replace all macro usages with netdev_dbg().
This is done with the following coccinelle script:
@@
expression sel;
expression list args;
identifier padapter;
identifier func;
@@
func(..., struct adapter *padapter, ...) {
<...
- DBG_871X_SEL_NL(sel, args);
+ netdev_dbg(padapter->pnetdev, args);
...>
}fix by hand one coccinelle output newline issue
--- drivers/staging/rtl8723bs/core/rtw_debug.c | 16 +++---- drivers/staging/rtl8723bs/core/rtw_odm.c | 50 +++++++++++----------- drivers/staging/rtl8723bs/hal/hal_com.c | 31 ++++++-------- 3 files changed, 47 insertions(+), 50 deletions(-)
drivers/staging/rtl8723bs/core/rtw_debug.c +8 -8
@@ -20,7 +20,7 @@ void sd_f0_reg_dump(void *sel, struct adapter *adapter)for (i =0x0 ; i <=0xff ; i++) {if (i%16 ==0 ) -DBG_871X_SEL_NL (sel,"0x%02x " , i); +netdev_dbg (adapter->pnetdev,"0x%02x " , i);DBG_871X_SEL (sel,"%02x " ,rtw_sd_f0_read8 (adapter, i));
@@ -35,11 +35,11 @@ void mac_reg_dump(void *sel, struct adapter *adapter) {int i, j =1 ; -DBG_871X_SEL_NL (sel,"======= MAC REG =======\n" ); +netdev_dbg (adapter->pnetdev,"======= MAC REG =======\n" );for (i =0x0 ; i <0x800 ; i +=4 ) {if (j%4 ==1 ) -DBG_871X_SEL_NL (sel,"0x%03x" , i); +netdev_dbg (adapter->pnetdev,"0x%03x" , i);DBG_871X_SEL (sel," 0x%08x " ,rtw_read32 (adapter, i));if ((j++)%4 ==0 )DBG_871X_SEL (sel,"\n" );
@@ -50,10 +50,10 @@ void bb_reg_dump(void *sel, struct adapter *adapter) {int i, j =1 ; -DBG_871X_SEL_NL (sel,"======= BB REG =======\n" ); +netdev_dbg (adapter->pnetdev,"======= BB REG =======\n" );for (i =0x800 ; i <0x1000 ; i +=4 ) {if (j%4 ==1 ) -DBG_871X_SEL_NL (sel,"0x%03x" , i); +netdev_dbg (adapter->pnetdev,"0x%03x" , i);DBG_871X_SEL (sel," 0x%08x " ,rtw_read32 (adapter, i));if ((j++)%4 ==0 )DBG_871X_SEL (sel,"\n" );
@@ -73,14 +73,14 @@ void rf_reg_dump(void *sel, struct adapter *adapter)else path_nums =2 ; -DBG_871X_SEL_NL (sel,"======= RF REG =======\n" ); +netdev_dbg (adapter->pnetdev,"======= RF REG =======\n" );for (path =0 ; path < path_nums; path++) { -DBG_871X_SEL_NL (sel,"RF_Path(%x)\n" , path); +netdev_dbg (adapter->pnetdev,"RF_Path(%x)\n" , path);for (i =0 ; i <0x100 ; i++) { value =rtw_hal_read_rfreg (adapter, path, i,0xffffffff );if (j%4 ==1 ) -DBG_871X_SEL_NL (sel,"0x%02x " , i); +netdev_dbg (adapter->pnetdev,"0x%02x " , i);DBG_871X_SEL (sel," 0x%08x " , value);if ((j++)%4 ==0 )DBG_871X_SEL (sel,"\n" );
drivers/staging/rtl8723bs/core/rtw_odm.c +26 -24
84 lines not on this page · raw message
drivers/staging/rtl8723bs/hal/hal_com.c +13 -18
@@ -1522,12 +1522,10 @@ void rtw_get_raw_rssi_info(void *sel, struct adapter *padapter)struct hal_com_data *pHalData =GET_HAL_DATA (padapter);struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info; -DBG_871X_SEL_NL ( - sel, -"RxRate = %s, PWDBALL = %d(%%), rx_pwr_all = %d(dBm)\n" , -HDATA_RATE (psample_pkt_rssi->data_rate), - psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all - ); +netdev_dbg (padapter->pnetdev, +"RxRate = %s, PWDBALL = %d(%%), rx_pwr_all = %d(dBm)\n" , +HDATA_RATE (psample_pkt_rssi->data_rate), + psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all); isCCKrate = psample_pkt_rssi->data_rate <=DESC_RATE11M ;
@@ -1535,20 +1533,17 @@ void rtw_get_raw_rssi_info(void *sel, struct adapter *padapter) psample_pkt_rssi->mimo_signal_strength[0 ] = psample_pkt_rssi->pwdball;for (rf_path =0 ; rf_path < pHalData->NumTotalRFPath; rf_path++) { -DBG_871X_SEL_NL ( - sel, -"RF_PATH_%d =>signal_strength:%d(%%), signal_quality:%d(%%)\n" , - rf_path, psample_pkt_rssi->mimo_signal_strength[rf_path], - psample_pkt_rssi->mimo_signal_quality[rf_path] - ); +netdev_dbg (padapter->pnetdev, +"RF_PATH_%d =>signal_strength:%d(%%), signal_quality:%d(%%)\n" , + rf_path, + psample_pkt_rssi->mimo_signal_strength[rf_path], + psample_pkt_rssi->mimo_signal_quality[rf_path]);if (!isCCKrate) { -DBG_871X_SEL_NL ( - sel, -"\trx_ofdm_pwr:%d(dBm), rx_ofdm_snr:%d(dB)\n" , - psample_pkt_rssi->ofdm_pwr[rf_path], - psample_pkt_rssi->ofdm_snr[rf_path] - ); +netdev_dbg (padapter->pnetdev, +"\trx_ofdm_pwr:%d(dBm), rx_ofdm_snr:%d(dB)\n" , + psample_pkt_rssi->ofdm_pwr[rf_path], + psample_pkt_rssi->ofdm_snr[rf_path]); } } }
Signature · 1 line
2.20.1
PATCH v2 2/3 staging: rtl8723bs: remove DBG_871X_SEL_NL macro declaration
In reply to Fabio Aiutoremove DBG_871X_SEL_NL obsolete macro declaration.
--- drivers/staging/rtl8723bs/include/rtw_debug.h | 9 --------- 1 file changed, 9 deletions(-)
drivers/staging/rtl8723bs/include/rtw_debug.h +0 -9
@@ -181,15 +181,6 @@ seq_printf(sel, fmt, ##arg); \ } while (0) -/* dump message to selected 'stream' with driver-defined prefix */ -#define DBG_871X_SEL_NL(sel, fmt, arg...) \ - do { \ - if (sel == RTW_DBGDUMP) \ - DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ - else \ - seq_printf(sel, fmt, ##arg); \ - } while (0) -#endif /* defined(_dbgdump) */ void sd_f0_reg_dump (void *sel,struct adapter *adapter);
Signature · 1 line
2.20.1
PATCH v2 3/3 staging: rtl8723bs: remove unused argument in function
In reply to Fabio Aiutoremoved unused 'void *sel' argument in rtw_odm_dbg_comp_msg() function, after DBG_871X_SEL_NL replacement.
--- drivers/staging/rtl8723bs/core/rtw_odm.c | 2 +- drivers/staging/rtl8723bs/include/rtw_odm.h | 2 +- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/core/rtw_odm.c +1 -1
@@ -90,7 +90,7 @@ static const char * const odm_dbg_level_str[] = {#define RTW_ODM_DBG_LEVEL_NUM 6 -void rtw_odm_dbg_comp_msg (void *sel,struct adapter *adapter) +void rtw_odm_dbg_comp_msg (struct adapter *adapter) {u64 dbg_comp;int i;
drivers/staging/rtl8723bs/include/rtw_odm.h +1 -1
@@ -13,7 +13,7 @@* This file provides utilities/wrappers for rtw driver to use ODM */ -void rtw_odm_dbg_comp_msg (void *sel,struct adapter *adapter); +void rtw_odm_dbg_comp_msg (struct adapter *adapter);void rtw_odm_dbg_comp_set (struct adapter *adapter,u64 comps);void rtw_odm_dbg_level_msg (void *sel,struct adapter *adapter);void rtw_odm_dbg_level_set (struct adapter *adapter,u32 level);
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +1 -1
@@ -2622,7 +2622,7 @@ static int rtw_dbg_port(struct net_device *dev,case 0x16 : {if (arg ==0xff ) { -rtw_odm_dbg_comp_msg (RTW_DBGDUMP , padapter); +rtw_odm_dbg_comp_msg (padapter); }else {u64 dbg_comp = (u64 )extra_arg;rtw_odm_dbg_comp_set (padapter, dbg_comp);
Signature · 1 line
2.20.1