diff options
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 6aa6987d96cb..812a1183c502 100644 --- a/drivers/net/wan/wanpipe_multppp.c +++ b/drivers/net/wan/wanpipe_multppp.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/wanrouter.h> /* WAN router definitions */ | 26 | #include <linux/wanrouter.h> /* WAN router definitions */ |
27 | #include <linux/wanpipe.h> /* WANPIPE common user API definitions */ | 27 | #include <linux/wanpipe.h> /* WANPIPE common user API definitions */ |
28 | #include <linux/if_arp.h> /* ARPHRD_* defines */ | 28 | #include <linux/if_arp.h> /* ARPHRD_* defines */ |
29 | #include <linux/jiffies.h> /* time_after() macro */ | ||
29 | 30 | ||
30 | #include <linux/in.h> /* sockaddr_in */ | 31 | #include <linux/in.h> /* sockaddr_in */ |
31 | #include <linux/inet.h> | 32 | #include <linux/inet.h> |
@@ -270,9 +271,9 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf) | |||
270 | ready to accept commands. We expect this to be completed in less | 271 | ready to accept commands. We expect this to be completed in less |
271 | than 1 second. */ | 272 | than 1 second. */ |
272 | 273 | ||
273 | timeout = jiffies; | 274 | timeout = jiffies + 1 * HZ; |
274 | while (mb->return_code != 'I') /* Wait 1s for board to initialize */ | 275 | while (mb->return_code != 'I') /* Wait 1s for board to initialize */ |
275 | if ((jiffies - timeout) > 1*HZ) break; | 276 | if (time_after(jiffies, timeout)) break; |
276 | 277 | ||
277 | if (mb->return_code != 'I') { | 278 | if (mb->return_code != 'I') { |
278 | printk(KERN_INFO | 279 | printk(KERN_INFO |
@@ -493,11 +494,11 @@ static int update(struct wan_device* wandev) | |||
493 | chdlc_priv_area->timer_int_enabled = TMR_INT_ENABLED_UPDATE; | 494 | chdlc_priv_area->timer_int_enabled = TMR_INT_ENABLED_UPDATE; |
494 | 495 | ||
495 | /* wait a maximum of 1 second for the statistics to be updated */ | 496 | /* wait a maximum of 1 second for the statistics to be updated */ |
496 | timeout = jiffies; | 497 | timeout = jiffies + 1 * HZ; |
497 | for(;;) { | 498 | for(;;) { |
498 | if(chdlc_priv_area->update_comms_stats == 0) | 499 | if(chdlc_priv_area->update_comms_stats == 0) |
499 | break; | 500 | break; |
500 | if ((jiffies - timeout) > (1 * HZ)){ | 501 | if (time_after(jiffies, timeout)){ |
501 | chdlc_priv_area->update_comms_stats = 0; | 502 | chdlc_priv_area->update_comms_stats = 0; |
502 | chdlc_priv_area->timer_int_enabled &= | 503 | chdlc_priv_area->timer_int_enabled &= |
503 | ~TMR_INT_ENABLED_UPDATE; | 504 | ~TMR_INT_ENABLED_UPDATE; |