]> git.hungrycats.org Git - linux/commitdiff
jiffies wrap fixes for net drivers atp, yam, and sb1000.
authorDave Jones <davej@suse.de>
Wed, 3 Apr 2002 12:26:52 +0000 (07:26 -0500)
committerJeff Garzik <jgarzik@mandrakesoft.com>
Wed, 3 Apr 2002 12:26:52 +0000 (07:26 -0500)
drivers/net/atp.c
drivers/net/hamradio/yam.c
drivers/net/sb1000.c

index 5a31cfe28fd93bd33856128dccca7a6e04065413..c3904af3bbe3d535ff439b9296ff4b284987f32c 100644 (file)
@@ -667,7 +667,7 @@ static void atp_interrupt(int irq, void *dev_instance, struct pt_regs * regs)
                        }
                        num_tx_since_rx++;
                } else if (num_tx_since_rx > 8
-                                  && jiffies > dev->last_rx + HZ) {
+                                  && time_after(jiffies, dev->last_rx + HZ)) {
                        if (net_debug > 2)
                                printk(KERN_DEBUG "%s: Missed packet? No Rx after %d Tx and "
                                           "%ld jiffies status %02x  CMR1 %02x.\n", dev->name,
index 7e175b3a51381fc95170ba16a4f3da09f9ae971b..d74a43f3ce20f647d822316fcc98ffa763847b3b 100644 (file)
@@ -308,7 +308,8 @@ static const unsigned char chktabh[256] =
 static void delay(int ms)
 {
        unsigned long timeout = jiffies + ((ms * HZ) / 1000);
-       while (jiffies < timeout);
+       while (time_before(jiffies, timeout))
+               cpu_relax();
 }
 
 /*
index a044d72c70cc3b03d0fc6719fdab847c85790f01..184b2a4c2aae091c8d7d500518fe37f5f6962fff 100644 (file)
@@ -405,7 +405,7 @@ sb1000_wait_for_ready(const int ioaddr[], const char* name)
        }
        timeout = jiffies + Sb1000TimeOutJiffies;
        while (!(inb(ioaddr[1] + 6) & 0x40)) {
-               if (jiffies >= timeout) {
+               if (time_after_eq(jiffies, timeout)) {
                        printk(KERN_WARNING "%s: sb1000_wait_for_ready timeout\n",
                                name);
                        return -ETIME;
@@ -423,7 +423,7 @@ sb1000_wait_for_ready_clear(const int ioaddr[], const char* name)
 
        timeout = jiffies + Sb1000TimeOutJiffies;
        while (inb(ioaddr[1] + 6) & 0x80) {
-               if (jiffies >= timeout) {
+               if (time_after_eq(jiffies, timeout)) {
                        printk(KERN_WARNING "%s: sb1000_wait_for_ready_clear timeout\n",
                                name);
                        return -ETIME;
@@ -431,7 +431,7 @@ sb1000_wait_for_ready_clear(const int ioaddr[], const char* name)
        }
        timeout = jiffies + Sb1000TimeOutJiffies;
        while (inb(ioaddr[1] + 6) & 0x40) {
-               if (jiffies >= timeout) {
+               if (time_after_eq(jiffies, timeout)) {
                        printk(KERN_WARNING "%s: sb1000_wait_for_ready_clear timeout\n",
                                name);
                        return -ETIME;