diff options
author | Manuel Schölling <manuel.schoelling@gmx.de> | 2014-05-21 16:08:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-22 15:50:12 -0400 |
commit | 87f03cc3c67d4a6b5c35119e339bab640600effb (patch) | |
tree | cd290d8c3b0b715ad382349a6ed30f9e4d68e120 /drivers/isdn | |
parent | 0797fb083f6588a800dfbff1aecbb2aed8d4f673 (diff) |
mISDN: Use mod_timer()
The code for resetting the timer can be simplified if mod_timer() is used
instead of del_timer() followed by add_timer().
Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/mISDN/l1oip_core.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index 084f9369249f..9f454d76cc06 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c | |||
@@ -287,11 +287,9 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, | |||
287 | p = frame; | 287 | p = frame; |
288 | 288 | ||
289 | /* restart timer */ | 289 | /* restart timer */ |
290 | if (time_before(hc->keep_tl.expires, jiffies + 5 * HZ)) { | 290 | if (time_before(hc->keep_tl.expires, jiffies + 5 * HZ)) |
291 | del_timer(&hc->keep_tl); | 291 | mod_timer(&hc->keep_tl, jiffies + L1OIP_KEEPALIVE * HZ); |
292 | hc->keep_tl.expires = jiffies + L1OIP_KEEPALIVE * HZ; | 292 | else |
293 | add_timer(&hc->keep_tl); | ||
294 | } else | ||
295 | hc->keep_tl.expires = jiffies + L1OIP_KEEPALIVE * HZ; | 293 | hc->keep_tl.expires = jiffies + L1OIP_KEEPALIVE * HZ; |
296 | 294 | ||
297 | if (debug & DEBUG_L1OIP_MSG) | 295 | if (debug & DEBUG_L1OIP_MSG) |
@@ -623,9 +621,7 @@ multiframe: | |||
623 | /* restart timer */ | 621 | /* restart timer */ |
624 | if (time_before(hc->timeout_tl.expires, jiffies + 5 * HZ) || !hc->timeout_on) { | 622 | if (time_before(hc->timeout_tl.expires, jiffies + 5 * HZ) || !hc->timeout_on) { |
625 | hc->timeout_on = 1; | 623 | hc->timeout_on = 1; |
626 | del_timer(&hc->timeout_tl); | 624 | mod_timer(&hc->timeout_tl, jiffies + L1OIP_TIMEOUT * HZ); |
627 | hc->timeout_tl.expires = jiffies + L1OIP_TIMEOUT * HZ; | ||
628 | add_timer(&hc->timeout_tl); | ||
629 | } else /* only adjust timer */ | 625 | } else /* only adjust timer */ |
630 | hc->timeout_tl.expires = jiffies + L1OIP_TIMEOUT * HZ; | 626 | hc->timeout_tl.expires = jiffies + L1OIP_TIMEOUT * HZ; |
631 | 627 | ||