Skip to contentSkip to conversation

Staging: rtl8712: Use mod_timer

PATCH New Vaishali Thakkar 1 participant 1 message Feb 25, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Staging: rtl8712: Use mod_timer

This patch introduces the use of API function mod_timer instead of driver specific function as it is a more efficient and standard way to update the expire field of an active timer.

---
Changes since v1:
-Edit commit message
-Remove unnecessory parenthesis
-Align second parameter of function
mod_timer properly
Changes since v2:
-Remove unnecessory parenthesis

 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/rtl8712/rtl871x_ioctl_linux.c +4 -3
index 9bb364f..5d4470a 100644
@@ -129,7 +129,8 @@ static inline void handle_pairwise_key(struct sta_info *psta,
 		memcpy(psta->tkiprxmickey. skey, &(param->u.crypt.
 			key[24]), 8);
 		padapter->securitypriv. busetkipkey = false;
-		_set_timer(&padapter->securitypriv.tkip_timer, 50);
+		mod_timer(&padapter->securitypriv.tkip_timer,
+			  jiffies + msecs_to_jiffies(50));
 	}
 	r8712_setstakey_cmd(padapter, (unsigned char *)psta, true);
 }
@@ -153,8 +154,8 @@ static inline void handle_group_key(struct ieee_param *param,
 		if (padapter->registrypriv.power_mgnt > PS_MODE_ACTIVE) {
 			if (padapter->registrypriv.power_mgnt != padapter->
 			    pwrctrlpriv.pwr_mode)
-				_set_timer(&(padapter->mlmepriv.dhcp_timer),
-					   60000);
+				mod_timer(&padapter->mlmepriv.dhcp_timer,
+					  jiffies + msecs_to_jiffies(60000));
 		}
 	}
 }
Signature · 1 line
1.9.1