diff options
author | Marcelo Feitoza Parisi <marcelo@feitoza.com.br> | 2005-07-15 09:59:26 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-15 09:59:26 -0700 |
commit | a8178345c4f12f4413e5620fc86a6b0381c41bc9 (patch) | |
tree | dd9cb8c953556d539eabd4137032873a6578e988 /drivers/net/wan/wanpipe_multppp.c | |
parent | 9d853c3757ef74ded5ae564d68370f22208fb88b (diff) |
[WAN]: drivers/net/wan/: use of time_after macro
From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Use of the time_after() macro, defined at linux/jiffies.h, which deal
with wrapping correctly and are nicer to read.
Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/wanpipe_multppp.c')
-rw-r--r-- | drivers/net/wan/wanpipe_multppp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wan/wanpipe_multppp.c b/drivers/net/wan/wanpipe_multppp.c index 6aa6987d96c..812a1183c50 100644 --- a/drivers/net/wan/wanpipe_multppp.c +++ b/drivers/net/wan/wanpipe_multppp.c @@ -26,6 +26,7 @@ #include <linux/wanrouter.h> /* WAN router definitions */ #include <linux/wanpipe.h> /* WANPIPE common user API definitions */ #include <linux/if_arp.h> /* ARPHRD_* defines */ +#include <linux/jiffies.h> /* time_after() macro */ #include <linux/in.h> /* sockaddr_in */ #include <linux/inet.h> @@ -270,9 +271,9 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf) ready to accept commands. We expect this to be completed in less than 1 second. */ - timeout = jiffies; + timeout = jiffies + 1 * HZ; while (mb->return_code != 'I') /* Wait 1s for board to initialize */ - if ((jiffies - timeout) > 1*HZ) break; + if (time_after(jiffies, timeout)) break; if (mb->return_code != 'I') { printk(KERN_INFO @@ -493,11 +494,11 @@ static int update(struct wan_device* wandev) chdlc_priv_area->timer_int_enabled = TMR_INT_ENABLED_UPDATE; /* wait a maximum of 1 second for the statistics to be updated */ - timeout = jiffies; + timeout = jiffies + 1 * HZ; for(;;) { if(chdlc_priv_area->update_comms_stats == 0) break; - if ((jiffies - timeout) > (1 * HZ)){ + if (time_after(jiffies, timeout)){ chdlc_priv_area->update_comms_stats = 0; chdlc_priv_area->timer_int_enabled &= ~TMR_INT_ENABLED_UPDATE; |