diff mbox

irda: use msecs_to_jiffies() rather than manual calculation

Message ID 1324472236-9681-1-git-send-email-xi.wang@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Xi Wang Dec. 21, 2011, 12:57 p.m. UTC
Also use mod_timer() instead of direct assignment to "expires".

Signed-off-by: Xi Wang <xi.wang@gmail.com>
---
 net/irda/af_irda.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller Dec. 21, 2011, 8:46 p.m. UTC | #1
From: Xi Wang <xi.wang@gmail.com>
Date: Wed, 21 Dec 2011 07:57:16 -0500

> Also use mod_timer() instead of direct assignment to "expires".
> 
> Signed-off-by: Xi Wang <xi.wang@gmail.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index c24f25a..bb14c34 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2558,8 +2558,8 @@  bed:
 			self->errno = 0;
 			setup_timer(&self->watchdog, irda_discovery_timeout,
 					(unsigned long)self);
-			self->watchdog.expires = jiffies + (val * HZ/1000);
-			add_timer(&(self->watchdog));
+			mod_timer(&self->watchdog,
+				  jiffies + msecs_to_jiffies(val));
 
 			/* Wait for IR-LMP to call us back */
 			__wait_event_interruptible(self->query_wait,