summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8712/mlme_linux.c
diff options
context:
space:
mode:
authorVaishali Thakkar <vthakkar1994@gmail.com>2015-02-27 20:55:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-02 04:02:11 +0300
commitc703c750cc247c5b06aef5cc054e62543c79e6b5 (patch)
treeed8f19521f770215159eb9424c9da823e43e471b /drivers/staging/rtl8712/mlme_linux.c
parent1862eec4fe45e2d33fb166af3f8e601fc2233d76 (diff)
downloadlinux-c703c750cc247c5b06aef5cc054e62543c79e6b5.tar.xz
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 <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/mlme_linux.c')
-rw-r--r--drivers/staging/rtl8712/mlme_linux.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/rtl8712/mlme_linux.c b/drivers/staging/rtl8712/mlme_linux.c
index 354bd03e700f..53999e8aa1c1 100644
--- a/drivers/staging/rtl8712/mlme_linux.c
+++ b/drivers/staging/rtl8712/mlme_linux.c
@@ -37,8 +37,8 @@ static void sitesurvey_ctrl_handler(void *FunctionContext)
struct _adapter *adapter = (struct _adapter *)FunctionContext;
_r8712_sitesurvey_ctrl_handler(adapter);
- _set_timer(&adapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
- 3000);
+ mod_timer(&adapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
+ jiffies + msecs_to_jiffies(3000));
}
static void join_timeout_handler (void *FunctionContext)
@@ -68,7 +68,8 @@ static void wdg_timeout_handler (void *FunctionContext)
_r8712_wdg_timeout_handler(adapter);
- _set_timer(&adapter->mlmepriv.wdg_timer, 2000);
+ mod_timer(&adapter->mlmepriv.wdg_timer,
+ jiffies + msecs_to_jiffies(2000));
}
void r8712_init_mlme_timer(struct _adapter *padapter)