diff options
author | Vaishali Thakkar <vthakkar1994@gmail.com> | 2015-02-27 23:25:48 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-01 17:02:11 -0800 |
commit | c703c750cc247c5b06aef5cc054e62543c79e6b5 (patch) | |
tree | ed8f19521f770215159eb9424c9da823e43e471b /drivers/staging/rtl8712/rtl871x_cmd.c | |
parent | 1862eec4fe45e2d33fb166af3f8e601fc2233d76 (diff) | |
download | op-kernel-dev-c703c750cc247c5b06aef5cc054e62543c79e6b5.zip op-kernel-dev-c703c750cc247c5b06aef5cc054e62543c79e6b5.tar.gz |
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/rtl871x_cmd.c')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_cmd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 939a2ec..d105ade 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -247,7 +247,8 @@ u8 r8712_sitesurvey_cmd(struct _adapter *padapter, } set_fwstate(pmlmepriv, _FW_UNDER_SURVEY); r8712_enqueue_cmd(pcmdpriv, ph2c); - _set_timer(&pmlmepriv->scan_to_timer, SCANNING_TIMEOUT); + mod_timer(&pmlmepriv->scan_to_timer, + jiffies + msecs_to_jiffies(SCANNING_TIMEOUT)); padapter->ledpriv.LedControlHandler(padapter, LED_CTL_SITE_SURVEY); padapter->blnEnableRxFF0Filter = 0; return _SUCCESS; @@ -890,7 +891,8 @@ void r8712_joinbss_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (pcmd->res != H2C_SUCCESS) - _set_timer(&pmlmepriv->assoc_timer, 1); + mod_timer(&pmlmepriv->assoc_timer, + jiffies + msecs_to_jiffies(1)); r8712_free_cmd_obj(pcmd); } @@ -907,7 +909,8 @@ void r8712_createbss_cmd_callback(struct _adapter *padapter, struct wlan_network *tgt_network = &(pmlmepriv->cur_network); if (pcmd->res != H2C_SUCCESS) - _set_timer(&pmlmepriv->assoc_timer, 1); + mod_timer(&pmlmepriv->assoc_timer, + jiffies + msecs_to_jiffies(1)); _cancel_timer(&pmlmepriv->assoc_timer, &timer_cancelled); #ifdef __BIG_ENDIAN /* endian_convert */ |