Commit 6501c8e7 authored by Vaishali Thakkar's avatar Vaishali Thakkar Committed by Greg Kroah-Hartman

Staging: rtl8712: Eliminate use of _cancel_timer_ex

Use timer API function del_timer_sync instead of driver
specific function _cancel_timer_ex as besides deactivating
a timer, it ensures that the timer is stopped on all
CPUs before the driver exists. Also, definition of function
_cancel_timer_ex is removed as it is no longer needed after
this change.

This is done using Coccinelle and semantic patch used for
this is as follows:

@@ expression x; @@

- _cancel_timer_ex (&x);
+ del_timer_sync (&x);
Signed-off-by: default avatarVaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2f1758d6
...@@ -263,13 +263,12 @@ static void start_drv_timers(struct _adapter *padapter) ...@@ -263,13 +263,12 @@ static void start_drv_timers(struct _adapter *padapter)
void r8712_stop_drv_timers(struct _adapter *padapter) void r8712_stop_drv_timers(struct _adapter *padapter)
{ {
_cancel_timer_ex(&padapter->mlmepriv.assoc_timer); del_timer_sync(&padapter->mlmepriv.assoc_timer);
_cancel_timer_ex(&padapter->securitypriv.tkip_timer); del_timer_sync(&padapter->securitypriv.tkip_timer);
_cancel_timer_ex(&padapter->mlmepriv.scan_to_timer); del_timer_sync(&padapter->mlmepriv.scan_to_timer);
_cancel_timer_ex(&padapter->mlmepriv.dhcp_timer); del_timer_sync(&padapter->mlmepriv.dhcp_timer);
_cancel_timer_ex(&padapter->mlmepriv.wdg_timer); del_timer_sync(&padapter->mlmepriv.wdg_timer);
_cancel_timer_ex(&padapter->mlmepriv.sitesurveyctrl. del_timer_sync(&padapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
sitesurvey_ctrl_timer);
} }
static u8 init_default_value(struct _adapter *padapter) static u8 init_default_value(struct _adapter *padapter)
......
...@@ -92,11 +92,6 @@ static inline void sleep_schedulable(int ms) ...@@ -92,11 +92,6 @@ static inline void sleep_schedulable(int ms)
schedule_timeout(delta); schedule_timeout(delta);
} }
static inline unsigned char _cancel_timer_ex(struct timer_list *ptimer)
{
return del_timer(ptimer);
}
static inline void flush_signals_thread(void) static inline void flush_signals_thread(void)
{ {
if (signal_pending(current)) if (signal_pending(current))
......
This diff is collapsed.
...@@ -698,7 +698,7 @@ void r8712_ind_disconnect(struct _adapter *padapter) ...@@ -698,7 +698,7 @@ void r8712_ind_disconnect(struct _adapter *padapter)
} }
if (padapter->pwrctrlpriv.pwr_mode != if (padapter->pwrctrlpriv.pwr_mode !=
padapter->registrypriv.power_mgnt) { padapter->registrypriv.power_mgnt) {
_cancel_timer_ex(&pmlmepriv->dhcp_timer); del_timer_sync(&pmlmepriv->dhcp_timer);
r8712_set_ps_mode(padapter, padapter->registrypriv.power_mgnt, r8712_set_ps_mode(padapter, padapter->registrypriv.power_mgnt,
padapter->registrypriv.smart_ps); padapter->registrypriv.smart_ps);
} }
......
...@@ -103,7 +103,7 @@ void r8712_cpwm_int_hdl(struct _adapter *padapter, ...@@ -103,7 +103,7 @@ void r8712_cpwm_int_hdl(struct _adapter *padapter,
if (pwrpriv->cpwm_tog == ((preportpwrstate->state) & 0x80)) if (pwrpriv->cpwm_tog == ((preportpwrstate->state) & 0x80))
return; return;
_cancel_timer_ex(&padapter->pwrctrlpriv. rpwm_check_timer); del_timer_sync(&padapter->pwrctrlpriv.rpwm_check_timer);
_enter_pwrlock(&pwrpriv->lock); _enter_pwrlock(&pwrpriv->lock);
pwrpriv->cpwm = (preportpwrstate->state) & 0xf; pwrpriv->cpwm = (preportpwrstate->state) & 0xf;
if (pwrpriv->cpwm >= PS_STATE_S2) { if (pwrpriv->cpwm >= PS_STATE_S2) {
......
...@@ -198,7 +198,7 @@ void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta) ...@@ -198,7 +198,7 @@ void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta)
* cancel reordering_ctrl_timer */ * cancel reordering_ctrl_timer */
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
preorder_ctrl = &psta->recvreorder_ctrl[i]; preorder_ctrl = &psta->recvreorder_ctrl[i];
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer); del_timer_sync(&preorder_ctrl->reordering_ctrl_timer);
} }
spin_lock(&(pfree_sta_queue->lock)); spin_lock(&(pfree_sta_queue->lock));
/* insert into free_sta_queue; 20061114 */ /* insert into free_sta_queue; 20061114 */
......
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