aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/wanpipe_multppp.c
diff options
context:
space:
mode:
authorMarcelo Feitoza Parisi <marcelo@feitoza.com.br>2005-07-15 12:59:26 -0400
committerDavid S. Miller <davem@davemloft.net>2005-07-15 12:59:26 -0400
commita8178345c4f12f4413e5620fc86a6b0381c41bc9 (patch)
treedd9cb8c953556d539eabd4137032873a6578e988 /drivers/net/wan/wanpipe_multppp.c
parent9d853c3757ef74ded5ae564d68370f22208fb88b (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.c9
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;