[PATCH 07/15] staging: rtl8723bs: remove unused code blocks conditioned by never set CONFIG_BACKGROUND_NOISE_MONITOR

Fabio Aiuto
2021-03-15T10:16:45Z

remove conditional code blocks checked by unused
CONFIG_BACKGROUND_NOISE_MONITOR

cleaning required in TODO file:

find and remove code blocks guarded by never set CONFIG_FOO defines

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 12 -----
drivers/staging/rtl8723bs/hal/hal_com.c | 35 -------------
drivers/staging/rtl8723bs/include/hal_com.h | 10 ----
drivers/staging/rtl8723bs/include/hal_data.h | 5 --
.../staging/rtl8723bs/os_dep/ioctl_linux.c | 50 +------------------
5 files changed, 1 insertion(+), 111 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 5d0611c5119b..e60a2ed32de5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -4211,18 +4211,6 @@ void site_survey(struct adapter *padapter)
channel_scan_time_ms = pmlmeext->chan_scan_time;

set_survey_timer(pmlmeext, channel_scan_time_ms);
-#ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- {
- struct noise_info info;
-
- info.bPauseDIG = false;
- info.IGIValue = 0;
- info.max_time = channel_scan_time_ms/2;/* ms */
- info.chan = survey_channel;
- rtw_hal_set_odm_var(padapter, HAL_ODM_NOISE_MONITOR, &info, false);
- }
-#endif
-
} else {

/* channel number is 0 or this channel is not valid. */
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 7c65ec60a982..bf07251a07d7 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -1262,20 +1262,6 @@ void GetHalODMVar(
)
{
switch (eVariable) {
-#ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- case HAL_ODM_NOISE_MONITOR:
- {
- struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
- u8 chan = *(u8 *)pValue1;
- *(s16 *)pValue2 = pHalData->noise[chan];
- #ifdef DBG_NOISE_MONITOR
- DBG_8192C("### Noise monitor chan(%d)-noise:%d (dBm) ###\n",
- chan, pHalData->noise[chan]);
- #endif
-
- }
- break;
-#endif/* ifdef CONFIG_BACKGROUND_NOISE_MONITOR */
default:
break;
}
@@ -1313,27 +1299,6 @@ void SetHalODMVar(
case HAL_ODM_WIFI_DISPLAY_STATE:
ODM_CmnInfoUpdate(podmpriv, ODM_CMNINFO_WIFI_DISPLAY, bSet);
break;
- #ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- case HAL_ODM_NOISE_MONITOR:
- {
- struct noise_info *pinfo = pValue1;
-
- #ifdef DBG_NOISE_MONITOR
- DBG_8192C("### Noise monitor chan(%d)-bPauseDIG:%d, IGIValue:0x%02x, max_time:%d (ms) ###\n",
- pinfo->chan, pinfo->bPauseDIG, pinfo->IGIValue, pinfo->max_time);
- #endif
-
- pHalData->noise[pinfo->chan] = ODM_InbandNoise_Monitor(podmpriv, pinfo->bPauseDIG, pinfo->IGIValue, pinfo->max_time);
- DBG_871X("chan_%d, noise = %d (dBm)\n", pinfo->chan, pHalData->noise[pinfo->chan]);
- #ifdef DBG_NOISE_MONITOR
- DBG_871X("noise_a = %d, noise_b = %d noise_all:%d\n",
- podmpriv->noise_level.noise[ODM_RF_PATH_A],
- podmpriv->noise_level.noise[ODM_RF_PATH_B],
- podmpriv->noise_level.noise_all);
- #endif
- }
- break;
- #endif/* ifdef CONFIG_BACKGROUND_NOISE_MONITOR */

default:
break;
diff --git a/drivers/staging/rtl8723bs/include/hal_com.h b/drivers/staging/rtl8723bs/include/hal_com.h
index c4b83eb16326..8669155dcddc 100644
--- a/drivers/staging/rtl8723bs/include/hal_com.h
+++ b/drivers/staging/rtl8723bs/include/hal_com.h
@@ -286,14 +286,4 @@ void SetHalODMVar(
enum HAL_ODM_VARIABLE eVariable,
void * pValue1,
bool bSet);
-
-#ifdef CONFIG_BACKGROUND_NOISE_MONITOR
-struct noise_info {
- u8 bPauseDIG;
- u8 IGIValue;
- u32 max_time;/* ms */
- u8 chan;
-};
-#endif
-
#endif /* __HAL_COMMON_H__ */
diff --git a/drivers/staging/rtl8723bs/include/hal_data.h b/drivers/staging/rtl8723bs/include/hal_data.h
index 8f5de747ae4e..8e75a334c60b 100644
--- a/drivers/staging/rtl8723bs/include/hal_data.h
+++ b/drivers/staging/rtl8723bs/include/hal_data.h
@@ -439,11 +439,6 @@ struct hal_com_data {
/* Interrupt related register information. */
u32 SysIntrStatus;
u32 SysIntrMask;
-
-#ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- s16 noise[ODM_MAX_CHANNEL_NUM];
-#endif
-
};

#define GET_HAL_DATA(__padapter) ((struct hal_com_data *)((__padapter)->HalData))
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index a52d04582aa1..b6ae7dfc51fe 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -313,12 +313,7 @@ static char *translate_scan(struct adapter *padapter,
/* Add quality statistics */
iwe.cmd = IWEVQUAL;
iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED
- #ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- | IW_QUAL_NOISE_UPDATED
- #else
- | IW_QUAL_NOISE_INVALID
- #endif
- ;
+ | IW_QUAL_NOISE_INVALID;

if (check_fwstate(pmlmepriv, _FW_LINKED) == true &&
is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) {
@@ -344,15 +339,7 @@ static char *translate_scan(struct adapter *padapter,

iwe.u.qual.qual = (u8)sq; /* signal quality */

- #ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- {
- s16 tmp_noise = 0;
- rtw_hal_get_odm_var(padapter, HAL_ODM_NOISE_MONITOR, &(pnetwork->network.Configuration.DSConfig), &(tmp_noise));
- iwe.u.qual.noise = tmp_noise;
- }
- #else
iwe.u.qual.noise = 0; /* noise level */
- #endif

/* DBG_871X("iqual =%d, ilevel =%d, inoise =%d, iupdated =%d\n", iwe.u.qual.qual, iwe.u.qual.level , iwe.u.qual.noise, iwe.u.qual.updated); */

@@ -3076,23 +3063,6 @@ static int rtw_dbg_port(struct net_device *dev,
}
}
break;
-#ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- case 0x1e:
- {
- struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
- PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
- u8 chan = rtw_get_oper_ch(padapter);
- DBG_871X("===========================================\n");
- ODM_InbandNoise_Monitor(pDM_Odm, true, 0x1e, 100);
- DBG_871X("channel(%d), noise_a = %d, noise_b = %d , noise_all:%d\n",
- chan, pDM_Odm->noise_level.noise[ODM_RF_PATH_A],
- pDM_Odm->noise_level.noise[ODM_RF_PATH_B],
- pDM_Odm->noise_level.noise_all);
- DBG_871X("===========================================\n");
-
- }
- break;
-#endif
case 0x23:
{
DBG_871X("turn %s the bNotifyChannelChange Variable\n", (extra_arg == 1)?"on":"off");
@@ -4734,24 +4704,6 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
#endif

tmp_qual = padapter->recvpriv.signal_qual;
-#ifdef CONFIG_BACKGROUND_NOISE_MONITOR
- if (rtw_linked_check(padapter)) {
- struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
- struct noise_info info;
- info.bPauseDIG = true;
- info.IGIValue = 0x1e;
- info.max_time = 100;/* ms */
- info.chan = pmlmeext->cur_channel ;/* rtw_get_oper_ch(padapter); */
- rtw_ps_deny(padapter, PS_DENY_IOCTL);
- LeaveAllPowerSaveModeDirect(padapter);
-
- rtw_hal_set_odm_var(padapter, HAL_ODM_NOISE_MONITOR, &info, false);
- /* ODM_InbandNoise_Monitor(podmpriv, true, 0x20, 100); */
- rtw_ps_deny_cancel(padapter, PS_DENY_IOCTL);
- rtw_hal_get_odm_var(padapter, HAL_ODM_NOISE_MONITOR, &(info.chan), &(padapter->recvpriv.noise));
- DBG_871X("chan:%d, noise_level:%d\n", info.chan, padapter->recvpriv.noise);
- }
-#endif
tmp_noise = padapter->recvpriv.noise;
DBG_871X("level:%d, qual:%d, noise:%d, rssi (%d)\n", tmp_level, tmp_qual, tmp_noise, padapter->recvpriv.rssi);

--
2.20.1