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

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/9d4597097d75a1900c65e4a15077eb0c8bce1c9b.1618401896.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Fabio Aiuto 2021-04-14 14:18:48 +02:00 committed by Greg Kroah-Hartman
parent d5c09ff069
commit 07d488b0c1
3 changed files with 47 additions and 50 deletions

View File

@ -20,7 +20,7 @@ void sd_f0_reg_dump(void *sel, struct adapter *adapter)
for (i = 0x0; i <= 0xff; i++) { for (i = 0x0; i <= 0xff; i++) {
if (i%16 == 0) 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)); 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; 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) { for (i = 0x0; i < 0x800; i += 4) {
if (j%4 == 1) 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)); DBG_871X_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++)%4 == 0) if ((j++)%4 == 0)
DBG_871X_SEL(sel, "\n"); DBG_871X_SEL(sel, "\n");
@ -50,10 +50,10 @@ void bb_reg_dump(void *sel, struct adapter *adapter)
{ {
int i, j = 1; 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) { for (i = 0x800; i < 0x1000 ; i += 4) {
if (j%4 == 1) 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)); DBG_871X_SEL(sel, " 0x%08x ", rtw_read32(adapter, i));
if ((j++)%4 == 0) if ((j++)%4 == 0)
DBG_871X_SEL(sel, "\n"); DBG_871X_SEL(sel, "\n");
@ -73,14 +73,14 @@ void rf_reg_dump(void *sel, struct adapter *adapter)
else else
path_nums = 2; 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++) { 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++) { for (i = 0; i < 0x100; i++) {
value = rtw_hal_read_rfreg(adapter, path, i, 0xffffffff); value = rtw_hal_read_rfreg(adapter, path, i, 0xffffffff);
if (j%4 == 1) 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); DBG_871X_SEL(sel, " 0x%08x ", value);
if ((j++)%4 == 0) if ((j++)%4 == 0)
DBG_871X_SEL(sel, "\n"); DBG_871X_SEL(sel, "\n");

View File

@ -96,12 +96,13 @@ void rtw_odm_dbg_comp_msg(void *sel, struct adapter *adapter)
int i; int i;
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &dbg_comp); rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &dbg_comp);
DBG_871X_SEL_NL(sel, "odm.DebugComponents = 0x%016llx\n", dbg_comp); netdev_dbg(adapter->pnetdev, "odm.DebugComponents = 0x%016llx\n",
dbg_comp);
for (i = 0; i < RTW_ODM_COMP_MAX; i++) { for (i = 0; i < RTW_ODM_COMP_MAX; i++) {
if (odm_comp_str[i]) if (odm_comp_str[i])
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n", netdev_dbg(adapter->pnetdev, "%cBIT%-2d %s\n",
(BIT0 << i) & dbg_comp ? '+' : ' ', (BIT0 << i) & dbg_comp ? '+' : ' ', i,
i, odm_comp_str[i]); odm_comp_str[i]);
} }
} }
@ -116,11 +117,11 @@ void rtw_odm_dbg_level_msg(void *sel, struct adapter *adapter)
int i; int i;
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &dbg_level); rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &dbg_level);
DBG_871X_SEL_NL(sel, "odm.DebugLevel = %u\n", dbg_level); netdev_dbg(adapter->pnetdev, "odm.DebugLevel = %u\n", dbg_level);
for (i = 0; i < RTW_ODM_DBG_LEVEL_NUM; i++) { for (i = 0; i < RTW_ODM_DBG_LEVEL_NUM; i++) {
if (odm_dbg_level_str[i]) if (odm_dbg_level_str[i])
DBG_871X_SEL_NL(sel, "%u %s\n", netdev_dbg(adapter->pnetdev, "%u %s\n", i,
i, odm_dbg_level_str[i]); odm_dbg_level_str[i]);
} }
} }
@ -135,12 +136,12 @@ void rtw_odm_ability_msg(void *sel, struct adapter *adapter)
int i; int i;
rtw_hal_get_hwreg(adapter, HW_VAR_DM_FLAG, (u8 *)&ability); rtw_hal_get_hwreg(adapter, HW_VAR_DM_FLAG, (u8 *)&ability);
DBG_871X_SEL_NL(sel, "odm.SupportAbility = 0x%08x\n", ability); netdev_dbg(adapter->pnetdev, "odm.SupportAbility = 0x%08x\n", ability);
for (i = 0; i < RTW_ODM_ABILITY_MAX; i++) { for (i = 0; i < RTW_ODM_ABILITY_MAX; i++) {
if (odm_ability_str[i]) if (odm_ability_str[i])
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n", netdev_dbg(adapter->pnetdev, "%cBIT%-2d %s\n",
(BIT0 << i) & ability ? '+' : ' ', i, (BIT0 << i) & ability ? '+' : ' ', i,
odm_ability_str[i]); odm_ability_str[i]);
} }
} }
@ -154,17 +155,17 @@ void rtw_odm_adaptivity_parm_msg(void *sel, struct adapter *adapter)
struct hal_com_data *pHalData = GET_HAL_DATA(adapter); struct hal_com_data *pHalData = GET_HAL_DATA(adapter);
struct dm_odm_t *odm = &pHalData->odmpriv; struct dm_odm_t *odm = &pHalData->odmpriv;
DBG_871X_SEL_NL(sel, "%10s %16s %8s %10s %11s %14s\n", netdev_dbg(adapter->pnetdev, "%10s %16s %8s %10s %11s %14s\n",
"TH_L2H_ini", "TH_EDCCA_HL_diff", "IGI_Base", "TH_L2H_ini", "TH_EDCCA_HL_diff", "IGI_Base", "ForceEDCCA",
"ForceEDCCA", "AdapEn_RSSI", "IGI_LowerBound"); "AdapEn_RSSI", "IGI_LowerBound");
DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-6x %-10d %-11u %-14u\n", netdev_dbg(adapter->pnetdev,
(u8)odm->TH_L2H_ini, "0x%-8x %-16d 0x%-6x %-10d %-11u %-14u\n",
odm->TH_EDCCA_HL_diff, (u8)odm->TH_L2H_ini,
odm->IGI_Base, odm->TH_EDCCA_HL_diff,
odm->ForceEDCCA, odm->IGI_Base,
odm->AdapEn_RSSI, odm->ForceEDCCA,
odm->IGI_LowerBound odm->AdapEn_RSSI,
); odm->IGI_LowerBound);
} }
void rtw_odm_adaptivity_parm_set(struct adapter *adapter, s8 TH_L2H_ini, void rtw_odm_adaptivity_parm_set(struct adapter *adapter, s8 TH_L2H_ini,
@ -188,6 +189,7 @@ void rtw_odm_get_perpkt_rssi(void *sel, struct adapter *adapter)
struct hal_com_data *hal_data = GET_HAL_DATA(adapter); struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
struct dm_odm_t *odm = &hal_data->odmpriv; struct dm_odm_t *odm = &hal_data->odmpriv;
DBG_871X_SEL_NL(sel, "RxRate = %s, RSSI_A = %d(%%), RSSI_B = %d(%%)\n", netdev_dbg(adapter->pnetdev,
HDATA_RATE(odm->RxRate), odm->RSSI_A, odm->RSSI_B); "RxRate = %s, RSSI_A = %d(%%), RSSI_B = %d(%%)\n",
HDATA_RATE(odm->RxRate), odm->RSSI_A, odm->RSSI_B);
} }

View File

@ -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 hal_com_data *pHalData = GET_HAL_DATA(padapter);
struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info; struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info;
DBG_871X_SEL_NL( netdev_dbg(padapter->pnetdev,
sel, "RxRate = %s, PWDBALL = %d(%%), rx_pwr_all = %d(dBm)\n",
"RxRate = %s, PWDBALL = %d(%%), rx_pwr_all = %d(dBm)\n", HDATA_RATE(psample_pkt_rssi->data_rate),
HDATA_RATE(psample_pkt_rssi->data_rate), psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all);
psample_pkt_rssi->pwdball, psample_pkt_rssi->pwr_all
);
isCCKrate = psample_pkt_rssi->data_rate <= DESC_RATE11M; 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; psample_pkt_rssi->mimo_signal_strength[0] = psample_pkt_rssi->pwdball;
for (rf_path = 0; rf_path < pHalData->NumTotalRFPath; rf_path++) { for (rf_path = 0; rf_path < pHalData->NumTotalRFPath; rf_path++) {
DBG_871X_SEL_NL( netdev_dbg(padapter->pnetdev,
sel, "RF_PATH_%d =>signal_strength:%d(%%), signal_quality:%d(%%)\n",
"RF_PATH_%d =>signal_strength:%d(%%), signal_quality:%d(%%)\n", rf_path,
rf_path, psample_pkt_rssi->mimo_signal_strength[rf_path], psample_pkt_rssi->mimo_signal_strength[rf_path],
psample_pkt_rssi->mimo_signal_quality[rf_path] psample_pkt_rssi->mimo_signal_quality[rf_path]);
);
if (!isCCKrate) { if (!isCCKrate) {
DBG_871X_SEL_NL( netdev_dbg(padapter->pnetdev,
sel, "\trx_ofdm_pwr:%d(dBm), rx_ofdm_snr:%d(dB)\n",
"\trx_ofdm_pwr:%d(dBm), rx_ofdm_snr:%d(dB)\n", psample_pkt_rssi->ofdm_pwr[rf_path],
psample_pkt_rssi->ofdm_pwr[rf_path], psample_pkt_rssi->ofdm_snr[rf_path]);
psample_pkt_rssi->ofdm_snr[rf_path]
);
} }
} }
} }