netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irda: use msecs_to_jiffies() rather than manual calculation
@ 2011-12-21 12:57 Xi Wang
  2011-12-21 20:46 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Xi Wang @ 2011-12-21 12:57 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: netdev, David S. Miller, Xi Wang

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(-)

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,
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] irda: use msecs_to_jiffies() rather than manual calculation
  2011-12-21 12:57 [PATCH] irda: use msecs_to_jiffies() rather than manual calculation Xi Wang
@ 2011-12-21 20:46 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-12-21 20:46 UTC (permalink / raw)
  To: xi.wang; +Cc: samuel, netdev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-21 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-21 12:57 [PATCH] irda: use msecs_to_jiffies() rather than manual calculation Xi Wang
2011-12-21 20:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).