From: Marcelo Feitoza Parisi <[EMAIL PROTECTED]>

Use of time_after() macro, defined at linux/jiffies.h, which deal with
wrapping correctly and are nicer to read.


Signed-off-by: Marcelo Feitoza Parisi <[EMAIL PROTECTED]>
Signed-off-by: Domen Puncer <[EMAIL PROTECTED]>

---
 zorro8390.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Index: quilt/drivers/net/zorro8390.c
===================================================================
--- quilt.orig/drivers/net/zorro8390.c
+++ quilt/drivers/net/zorro8390.c
@@ -27,6 +27,7 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/zorro.h>
+#include <linux/jiffies.h>
 
 #include <asm/system.h>
 #include <asm/irq.h>
@@ -151,7 +152,7 @@ static int __devinit zorro8390_init(stru
        z_writeb(z_readb(ioaddr + NE_RESET), ioaddr + NE_RESET);
 
        while ((z_readb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0)
-           if (jiffies - reset_start_time > 2*HZ/100) {
+           if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
                printk(KERN_WARNING " not found (no reset ack).\n");
                return -ENODEV;
            }
@@ -273,7 +274,7 @@ static void zorro8390_reset_8390(struct 
 
     /* This check _should_not_ be necessary, omit eventually. */
     while ((z_readb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0)
-       if (jiffies - reset_start_time > 2*HZ/100) {
+       if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
            printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n",
                   dev->name);
            break;
@@ -400,7 +401,7 @@ static void zorro8390_block_output(struc
     dma_start = jiffies;
 
     while ((z_readb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0)
-       if (jiffies - dma_start > 2*HZ/100) {           /* 20ms */
+       if (time_after(jiffies, dma_start + 2*HZ/100)) {        /* 20ms */
                printk(KERN_ERR "%s: timeout waiting for Tx RDC.\n",
                       dev->name);
                zorro8390_reset_8390(dev);

--
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to