Commit fb127a61 authored by Ross Schmidt's avatar Ross Schmidt Committed by Greg Kroah-Hartman

staging: rtl8723bs: replace _cancel_timer with del_timer_sync

Replace _cancel_timer with API function del_timer_sync.

One instance of del_timer_sync is moved and an unnecessary pair of spin
locks are removed.
Signed-off-by: default avatarRoss Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-8-ross.schm.dev@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2e8f201
...@@ -2034,7 +2034,6 @@ void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) ...@@ -2034,7 +2034,6 @@ void rtw_joinbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
{ {
u8 timer_cancelled;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct wlan_network *pwlan = NULL; struct wlan_network *pwlan = NULL;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
...@@ -2049,7 +2048,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) ...@@ -2049,7 +2048,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
_set_timer(&pmlmepriv->assoc_timer, 1); _set_timer(&pmlmepriv->assoc_timer, 1);
} }
_cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled); del_timer_sync(&pmlmepriv->assoc_timer);
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
......
...@@ -814,7 +814,6 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) ...@@ -814,7 +814,6 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
{ {
u8 timer_cancelled = false;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
...@@ -827,22 +826,12 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) ...@@ -827,22 +826,12 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_surveydone_event_callback: fw_state:%x\n\n", get_fwstate(pmlmepriv))); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_surveydone_event_callback: fw_state:%x\n\n", get_fwstate(pmlmepriv)));
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
/* u8 timer_cancelled; */ del_timer_sync(&pmlmepriv->scan_to_timer);
timer_cancelled = true;
/* _cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled); */
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
} else { } else {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv))); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv)));
} }
spin_unlock_bh(&pmlmepriv->lock);
if (timer_cancelled)
_cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled);
spin_lock_bh(&pmlmepriv->lock);
rtw_set_signal_stat_timer(&adapter->recvpriv); rtw_set_signal_stat_timer(&adapter->recvpriv);
...@@ -1298,7 +1287,6 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net ...@@ -1298,7 +1287,6 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
{ {
static u8 retry; static u8 retry;
u8 timer_cancelled;
struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL; struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
struct sta_priv *pstapriv = &adapter->stapriv; struct sta_priv *pstapriv = &adapter->stapriv;
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
...@@ -1392,7 +1380,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) ...@@ -1392,7 +1380,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
} }
/* s5. Cancel assoc_timer */ /* s5. Cancel assoc_timer */
_cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled); del_timer_sync(&pmlmepriv->assoc_timer);
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("Cancel assoc_timer\n")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("Cancel assoc_timer\n"));
......
...@@ -945,8 +945,7 @@ void sd_int_dpc(struct adapter *adapter) ...@@ -945,8 +945,7 @@ void sd_int_dpc(struct adapter *adapter)
if (hal->sdio_hisr & SDIO_HISR_CPWM1) { if (hal->sdio_hisr & SDIO_HISR_CPWM1) {
struct reportpwrstate_parm report; struct reportpwrstate_parm report;
u8 bcancelled; del_timer_sync(&(pwrctl->pwr_rpwm_timer));
_cancel_timer(&(pwrctl->pwr_rpwm_timer), &bcancelled);
report.state = SdioLocalCmd52Read1Byte(adapter, SDIO_REG_HCPWM1_8723B); report.state = SdioLocalCmd52Read1Byte(adapter, SDIO_REG_HCPWM1_8723B);
......
...@@ -83,12 +83,6 @@ static inline void _set_timer(_timer *ptimer, u32 delay_time) ...@@ -83,12 +83,6 @@ static inline void _set_timer(_timer *ptimer, u32 delay_time)
mod_timer(ptimer, (jiffies + (delay_time * HZ / 1000))); mod_timer(ptimer, (jiffies + (delay_time * HZ / 1000)));
} }
static inline void _cancel_timer(_timer *ptimer, u8 *bcancelled)
{
del_timer_sync(ptimer);
*bcancelled = true;/* true == 1; false == 0 */
}
static inline void _init_workitem(_workitem *pwork, void *pfunc, void *cntx) static inline void _init_workitem(_workitem *pwork, void *pfunc, void *cntx)
{ {
INIT_WORK(pwork, pfunc); INIT_WORK(pwork, pfunc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment