irda: use msecs_to_jiffies() rather than manual calculation
authorXi Wang <xi.wang@gmail.com>
Wed, 21 Dec 2011 02:57:16 +0000 (02:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Dec 2011 20:46:22 +0000 (15:46 -0500)
Also use mod_timer() instead of direct assignment to "expires".

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/irda/af_irda.c

index c24f25a..bb14c34 100644 (file)
@@ -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,