diff options
author | Marcelo Feitoza Parisi <marcelo@feitoza.com.br> | 2006-01-09 21:37:15 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 07:59:23 -0500 |
commit | ff5688ae1cedfb175b5ed0f319d03ad2e5ee005d (patch) | |
tree | eca0d41b3eefc833238591e0100a8136f21269a7 /drivers/net/ne.c | |
parent | e03d72b99e4027504ada134bf1804d6ea792b206 (diff) |
[PATCH] drivers/net/*: use time_after() and friends
They deal with wrapping correctly and are nicer to read. Also make
jiffies-holding variables unsigned long.
Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/ne.c')
-rw-r--r-- | drivers/net/ne.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 94f782d51f0f..08b218c5bfbc 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -50,6 +50,7 @@ static const char version2[] = | |||
50 | #include <linux/delay.h> | 50 | #include <linux/delay.h> |
51 | #include <linux/netdevice.h> | 51 | #include <linux/netdevice.h> |
52 | #include <linux/etherdevice.h> | 52 | #include <linux/etherdevice.h> |
53 | #include <linux/jiffies.h> | ||
53 | 54 | ||
54 | #include <asm/system.h> | 55 | #include <asm/system.h> |
55 | #include <asm/io.h> | 56 | #include <asm/io.h> |
@@ -341,7 +342,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr) | |||
341 | outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET); | 342 | outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET); |
342 | 343 | ||
343 | while ((inb_p(ioaddr + EN0_ISR) & ENISR_RESET) == 0) | 344 | while ((inb_p(ioaddr + EN0_ISR) & ENISR_RESET) == 0) |
344 | if (jiffies - reset_start_time > 2*HZ/100) { | 345 | if (time_after(jiffies, reset_start_time + 2*HZ/100)) { |
345 | if (bad_card) { | 346 | if (bad_card) { |
346 | printk(" (warning: no reset ack)"); | 347 | printk(" (warning: no reset ack)"); |
347 | break; | 348 | break; |
@@ -580,7 +581,7 @@ static void ne_reset_8390(struct net_device *dev) | |||
580 | 581 | ||
581 | /* This check _should_not_ be necessary, omit eventually. */ | 582 | /* This check _should_not_ be necessary, omit eventually. */ |
582 | while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) | 583 | while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) |
583 | if (jiffies - reset_start_time > 2*HZ/100) { | 584 | if (time_after(jiffies, reset_start_time + 2*HZ/100)) { |
584 | printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", dev->name); | 585 | printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", dev->name); |
585 | break; | 586 | break; |
586 | } | 587 | } |
@@ -787,7 +788,7 @@ retry: | |||
787 | #endif | 788 | #endif |
788 | 789 | ||
789 | while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) | 790 | while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) |
790 | if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ | 791 | if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ |
791 | printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name); | 792 | printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name); |
792 | ne_reset_8390(dev); | 793 | ne_reset_8390(dev); |
793 | NS8390_init(dev,1); | 794 | NS8390_init(dev,1); |