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/zorro8390.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/zorro8390.c')
-rw-r--r-- | drivers/net/zorro8390.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c index 8ab6e12153ba..761021603597 100644 --- a/drivers/net/zorro8390.c +++ b/drivers/net/zorro8390.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/netdevice.h> | 27 | #include <linux/netdevice.h> |
28 | #include <linux/etherdevice.h> | 28 | #include <linux/etherdevice.h> |
29 | #include <linux/zorro.h> | 29 | #include <linux/zorro.h> |
30 | #include <linux/jiffies.h> | ||
30 | 31 | ||
31 | #include <asm/system.h> | 32 | #include <asm/system.h> |
32 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
@@ -151,7 +152,7 @@ static int __devinit zorro8390_init(struct net_device *dev, | |||
151 | z_writeb(z_readb(ioaddr + NE_RESET), ioaddr + NE_RESET); | 152 | z_writeb(z_readb(ioaddr + NE_RESET), ioaddr + NE_RESET); |
152 | 153 | ||
153 | while ((z_readb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0) | 154 | while ((z_readb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0) |
154 | if (jiffies - reset_start_time > 2*HZ/100) { | 155 | if (time_after(jiffies, reset_start_time + 2*HZ/100)) { |
155 | printk(KERN_WARNING " not found (no reset ack).\n"); | 156 | printk(KERN_WARNING " not found (no reset ack).\n"); |
156 | return -ENODEV; | 157 | return -ENODEV; |
157 | } | 158 | } |
@@ -273,7 +274,7 @@ static void zorro8390_reset_8390(struct net_device *dev) | |||
273 | 274 | ||
274 | /* This check _should_not_ be necessary, omit eventually. */ | 275 | /* This check _should_not_ be necessary, omit eventually. */ |
275 | while ((z_readb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0) | 276 | while ((z_readb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0) |
276 | if (jiffies - reset_start_time > 2*HZ/100) { | 277 | if (time_after(jiffies, reset_start_time + 2*HZ/100)) { |
277 | printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", | 278 | printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", |
278 | dev->name); | 279 | dev->name); |
279 | break; | 280 | break; |
@@ -400,7 +401,7 @@ static void zorro8390_block_output(struct net_device *dev, int count, | |||
400 | dma_start = jiffies; | 401 | dma_start = jiffies; |
401 | 402 | ||
402 | while ((z_readb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) | 403 | while ((z_readb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) |
403 | if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ | 404 | if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ |
404 | printk(KERN_ERR "%s: timeout waiting for Tx RDC.\n", | 405 | printk(KERN_ERR "%s: timeout waiting for Tx RDC.\n", |
405 | dev->name); | 406 | dev->name); |
406 | zorro8390_reset_8390(dev); | 407 | zorro8390_reset_8390(dev); |