Commit d56ec794 authored by Dave Jones's avatar Dave Jones Committed by Jeff Garzik

jiffies wrap fixes for net drivers atp, yam, and sb1000.

parent 8855ed68
......@@ -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,
......
......@@ -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();
}
/*
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment