From c703c750cc247c5b06aef5cc054e62543c79e6b5 Mon Sep 17 00:00:00 2001 From: Vaishali Thakkar Date: Fri, 27 Feb 2015 23:25:48 +0530 Subject: Staging: rtl8712: Eliminate use of _set_timer This patch introduces the use of API function mod_timer instead of driver specific function _set_timer as it is a more efficient and standard way to update the expire field of an active timer. Also, definition of function _set_timer is removed as it is no longer needed after this change. Here, these cases are handled using Coccinelle and semantic patch used for this is as follows: @@ expression x; expression y;@@ - _set_timer (&x, y); + mod_timer (&x, jiffies + msecs_to_jiffies (y)); Signed-off-by: Vaishali Thakkar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/os_intfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/staging/rtl8712/os_intfs.c') diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index 13debb59ad97..64cdceead13b 100644 --- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -255,9 +255,10 @@ void r8712_stop_drv_threads(struct _adapter *padapter) static void start_drv_timers(struct _adapter *padapter) { - _set_timer(&padapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer, - 5000); - _set_timer(&padapter->mlmepriv.wdg_timer, 2000); + mod_timer(&padapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer, + jiffies + msecs_to_jiffies(5000)); + mod_timer(&padapter->mlmepriv.wdg_timer, + jiffies + msecs_to_jiffies(2000)); } void r8712_stop_drv_timers(struct _adapter *padapter) -- cgit v1.2.3