Commit 7d6c429b authored by Xi Wang's avatar Xi Wang Committed by David S. Miller

irda: use msecs_to_jiffies() rather than manual calculation

Also use mod_timer() instead of direct assignment to "expires".
Signed-off-by: default avatarXi Wang <xi.wang@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b993268
......@@ -2558,8 +2558,8 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,
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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment