Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Marcelo Feitoza Parisi and committed by
Jeff Garzik
ff5688ae e03d72b9

+65 -45
+5 -4
drivers/net/3c523.c
··· 105 105 #include <linux/mca-legacy.h> 106 106 #include <linux/ethtool.h> 107 107 #include <linux/bitops.h> 108 + #include <linux/jiffies.h> 108 109 109 110 #include <asm/uaccess.h> 110 111 #include <asm/processor.h> ··· 659 658 660 659 s = jiffies; /* warning: only active with interrupts on !! */ 661 660 while (!(cfg_cmd->cmd_status & STAT_COMPL)) { 662 - if (jiffies - s > 30*HZ/100) 661 + if (time_after(jiffies, s + 30*HZ/100)) 663 662 break; 664 663 } 665 664 ··· 685 684 686 685 s = jiffies; 687 686 while (!(ias_cmd->cmd_status & STAT_COMPL)) { 688 - if (jiffies - s > 30*HZ/100) 687 + if (time_after(jiffies, s + 30*HZ/100)) 689 688 break; 690 689 } 691 690 ··· 710 709 711 710 s = jiffies; 712 711 while (!(tdr_cmd->cmd_status & STAT_COMPL)) { 713 - if (jiffies - s > 30*HZ/100) { 712 + if (time_after(jiffies, s + 30*HZ/100)) { 714 713 printk(KERN_WARNING "%s: %d Problems while running the TDR.\n", dev->name, __LINE__); 715 714 result = 1; 716 715 break; ··· 799 798 elmc_id_attn586(); 800 799 s = jiffies; 801 800 while (!(mc_cmd->cmd_status & STAT_COMPL)) { 802 - if (jiffies - s > 30*HZ/100) 801 + if (time_after(jiffies, s + 30*HZ/100)) 803 802 break; 804 803 } 805 804 if (!(mc_cmd->cmd_status & STAT_COMPL)) {
+2 -1
drivers/net/3c59x.c
··· 258 258 #include <linux/highmem.h> 259 259 #include <linux/eisa.h> 260 260 #include <linux/bitops.h> 261 + #include <linux/jiffies.h> 261 262 #include <asm/irq.h> /* For NR_IRQS only. */ 262 263 #include <asm/io.h> 263 264 #include <asm/uaccess.h> ··· 2718 2717 skb = dev_alloc_skb(PKT_BUF_SZ); 2719 2718 if (skb == NULL) { 2720 2719 static unsigned long last_jif; 2721 - if ((jiffies - last_jif) > 10 * HZ) { 2720 + if (time_after(jiffies, last_jif + 10 * HZ)) { 2722 2721 printk(KERN_WARNING "%s: memory shortage\n", dev->name); 2723 2722 last_jif = jiffies; 2724 2723 }
+4 -3
drivers/net/apne.c
··· 36 36 #include <linux/delay.h> 37 37 #include <linux/netdevice.h> 38 38 #include <linux/etherdevice.h> 39 + #include <linux/jiffies.h> 39 40 40 41 #include <asm/system.h> 41 42 #include <asm/io.h> ··· 217 216 outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET); 218 217 219 218 while ((inb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0) 220 - if (jiffies - reset_start_time > 2*HZ/100) { 219 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 221 220 printk(" not found (no reset ack).\n"); 222 221 return -ENODEV; 223 222 } ··· 383 382 384 383 /* This check _should_not_ be necessary, omit eventually. */ 385 384 while ((inb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0) 386 - if (jiffies - reset_start_time > 2*HZ/100) { 385 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 387 386 printk("%s: ne_reset_8390() did not complete.\n", dev->name); 388 387 break; 389 388 } ··· 531 530 dma_start = jiffies; 532 531 533 532 while ((inb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) 534 - if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ 533 + if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 535 534 printk("%s: timeout waiting for Tx RDC.\n", dev->name); 536 535 apne_reset_8390(dev); 537 536 NS8390_init(dev,1);
+2 -1
drivers/net/arcnet/arcnet.c
··· 52 52 #include <net/arp.h> 53 53 #include <linux/init.h> 54 54 #include <linux/arcdevice.h> 55 + #include <linux/jiffies.h> 55 56 56 57 /* "do nothing" functions for protocol drivers */ 57 58 static void null_rx(struct net_device *dev, int bufnum, ··· 734 733 735 734 spin_unlock_irqrestore(&lp->lock, flags); 736 735 737 - if (jiffies - lp->last_timeout > 10*HZ) { 736 + if (time_after(jiffies, lp->last_timeout + 10*HZ)) { 738 737 BUGMSG(D_EXTRA, "tx timed out%s (status=%Xh, intmask=%Xh, dest=%02Xh)\n", 739 738 msg, status, lp->intmask, lp->lasttrans_dest); 740 739 lp->last_timeout = jiffies;
+2 -1
drivers/net/arm/etherh.c
··· 46 46 #include <linux/device.h> 47 47 #include <linux/init.h> 48 48 #include <linux/bitops.h> 49 + #include <linux/jiffies.h> 49 50 50 51 #include <asm/system.h> 51 52 #include <asm/ecard.h> ··· 356 355 dma_start = jiffies; 357 356 358 357 while ((readb (addr + EN0_ISR) & ENISR_RDC) == 0) 359 - if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ 358 + if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 360 359 printk(KERN_ERR "%s: timeout waiting for TX RDC\n", 361 360 dev->name); 362 361 etherh_reset (dev);
+6 -5
drivers/net/eth16i.c
··· 161 161 #include <linux/etherdevice.h> 162 162 #include <linux/skbuff.h> 163 163 #include <linux/bitops.h> 164 + #include <linux/jiffies.h> 164 165 165 166 #include <asm/system.h> 166 167 #include <asm/io.h> ··· 755 754 756 755 static int eth16i_send_probe_packet(int ioaddr, unsigned char *b, int l) 757 756 { 758 - int starttime; 757 + unsigned long starttime; 759 758 760 759 outb(0xff, ioaddr + TX_STATUS_REG); 761 760 ··· 766 765 outb(TX_START | 1, ioaddr + TRANSMIT_START_REG); 767 766 768 767 while( (inb(ioaddr + TX_STATUS_REG) & 0x80) == 0) { 769 - if( (jiffies - starttime) > TX_TIMEOUT) { 768 + if( time_after(jiffies, starttime + TX_TIMEOUT)) { 770 769 return -1; 771 770 } 772 771 } ··· 776 775 777 776 static int eth16i_receive_probe_packet(int ioaddr) 778 777 { 779 - int starttime; 778 + unsigned long starttime; 780 779 781 780 starttime = jiffies; 782 781 783 782 while((inb(ioaddr + TX_STATUS_REG) & 0x20) == 0) { 784 - if( (jiffies - starttime) > TX_TIMEOUT) { 783 + if( time_after(jiffies, starttime + TX_TIMEOUT)) { 785 784 786 785 if(eth16i_debug > 1) 787 786 printk(KERN_DEBUG "Timeout occurred waiting transmit packet received\n"); 788 787 starttime = jiffies; 789 788 while((inb(ioaddr + RX_STATUS_REG) & 0x80) == 0) { 790 - if( (jiffies - starttime) > TX_TIMEOUT) { 789 + if( time_after(jiffies, starttime + TX_TIMEOUT)) { 791 790 if(eth16i_debug > 1) 792 791 printk(KERN_DEBUG "Timeout occurred waiting receive packet\n"); 793 792 return -1;
+1 -1
drivers/net/hamradio/baycom_epp.c
··· 905 905 /* autoprobe baud rate */ 906 906 tstart = jiffies; 907 907 i = 0; 908 - while ((signed)(jiffies-tstart-HZ/3) < 0) { 908 + while (time_before(jiffies, tstart + HZ/3)) { 909 909 if (pp->ops->epp_read_addr(pp, &stat, 1, 0) != 1) 910 910 goto epptimeout; 911 911 if ((stat & (EPP_NRAEF|EPP_NRHF)) == EPP_NRHF) {
+3 -2
drivers/net/hp100.c
··· 115 115 #include <linux/delay.h> 116 116 #include <linux/init.h> 117 117 #include <linux/bitops.h> 118 + #include <linux/jiffies.h> 118 119 119 120 #include <asm/io.h> 120 121 ··· 1500 1499 printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name); 1501 1500 #endif 1502 1501 /* not waited long enough since last tx? */ 1503 - if (jiffies - dev->trans_start < HZ) 1502 + if (time_before(jiffies, dev->trans_start + HZ)) 1504 1503 return -EAGAIN; 1505 1504 1506 1505 if (hp100_check_lan(dev)) ··· 1653 1652 printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i); 1654 1653 #endif 1655 1654 /* not waited long enough since last failed tx try? */ 1656 - if (jiffies - dev->trans_start < HZ) { 1655 + if (time_before(jiffies, dev->trans_start + HZ)) { 1657 1656 #ifdef HP100_DEBUG 1658 1657 printk("hp100: %s: trans_start timing problem\n", 1659 1658 dev->name);
+3 -2
drivers/net/ne-h8300.c
··· 27 27 #include <linux/delay.h> 28 28 #include <linux/netdevice.h> 29 29 #include <linux/etherdevice.h> 30 + #include <linux/jiffies.h> 30 31 31 32 #include <asm/system.h> 32 33 #include <asm/io.h> ··· 366 365 367 366 /* This check _should_not_ be necessary, omit eventually. */ 368 367 while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) 369 - if (jiffies - reset_start_time > 2*HZ/100) { 368 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 370 369 printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", dev->name); 371 370 break; 372 371 } ··· 581 580 #endif 582 581 583 582 while ((inb_p(NE_BASE + EN0_ISR) & ENISR_RDC) == 0) 584 - if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ 583 + if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 585 584 printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name); 586 585 ne_reset_8390(dev); 587 586 NS8390_init(dev,1);
+4 -3
drivers/net/ne.c
··· 50 50 #include <linux/delay.h> 51 51 #include <linux/netdevice.h> 52 52 #include <linux/etherdevice.h> 53 + #include <linux/jiffies.h> 53 54 54 55 #include <asm/system.h> 55 56 #include <asm/io.h> ··· 342 341 outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET); 343 342 344 343 while ((inb_p(ioaddr + EN0_ISR) & ENISR_RESET) == 0) 345 - if (jiffies - reset_start_time > 2*HZ/100) { 344 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 346 345 if (bad_card) { 347 346 printk(" (warning: no reset ack)"); 348 347 break; ··· 581 580 582 581 /* This check _should_not_ be necessary, omit eventually. */ 583 582 while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) 584 - if (jiffies - reset_start_time > 2*HZ/100) { 583 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 585 584 printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", dev->name); 586 585 break; 587 586 } ··· 788 787 #endif 789 788 790 789 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) 791 - if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ 790 + if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 792 791 printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name); 793 792 ne_reset_8390(dev); 794 793 NS8390_init(dev,1);
+4 -3
drivers/net/ne2.c
··· 75 75 #include <linux/etherdevice.h> 76 76 #include <linux/skbuff.h> 77 77 #include <linux/bitops.h> 78 + #include <linux/jiffies.h> 78 79 79 80 #include <asm/system.h> 80 81 #include <asm/io.h> ··· 396 395 outb(inb(base_addr + NE_RESET), base_addr + NE_RESET); 397 396 398 397 while ((inb_p(base_addr + EN0_ISR) & ENISR_RESET) == 0) 399 - if (jiffies - reset_start_time > 2*HZ/100) { 398 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 400 399 printk(" not found (no reset ack).\n"); 401 400 retval = -ENODEV; 402 401 goto out; ··· 549 548 550 549 /* This check _should_not_ be necessary, omit eventually. */ 551 550 while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) 552 - if (jiffies - reset_start_time > 2*HZ/100) { 551 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 553 552 printk("%s: ne_reset_8390() did not complete.\n", 554 553 dev->name); 555 554 break; ··· 750 749 #endif 751 750 752 751 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) 753 - if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ 752 + if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 754 753 printk("%s: timeout waiting for Tx RDC.\n", dev->name); 755 754 ne_reset_8390(dev); 756 755 NS8390_init(dev,1);
+3 -2
drivers/net/ns83820.c
··· 116 116 #include <linux/timer.h> 117 117 #include <linux/if_vlan.h> 118 118 #include <linux/rtnetlink.h> 119 + #include <linux/jiffies.h> 119 120 120 121 #include <asm/io.h> 121 122 #include <asm/uaccess.h> ··· 1608 1607 { 1609 1608 struct ns83820 *dev = PRIV(ndev); 1610 1609 int timed_out = 0; 1611 - long start; 1610 + unsigned long start; 1612 1611 u32 status; 1613 1612 int loops = 0; 1614 1613 ··· 1626 1625 break; 1627 1626 if (status & fail) 1628 1627 break; 1629 - if ((jiffies - start) >= HZ) { 1628 + if (time_after_eq(jiffies, start + HZ)) { 1630 1629 timed_out = 1; 1631 1630 break; 1632 1631 }
+2 -1
drivers/net/oaknet.c
··· 20 20 #include <linux/netdevice.h> 21 21 #include <linux/etherdevice.h> 22 22 #include <linux/init.h> 23 + #include <linux/jiffies.h> 23 24 24 25 #include <asm/board.h> 25 26 #include <asm/io.h> ··· 607 606 #endif 608 607 609 608 while ((ei_ibp(base + EN0_ISR) & ENISR_RDC) == 0) { 610 - if (jiffies - start > OAKNET_WAIT) { 609 + if (time_after(jiffies, start + OAKNET_WAIT)) { 611 610 printk("%s: timeout waiting for Tx RDC.\n", dev->name); 612 611 oaknet_reset_8390(dev); 613 612 NS8390_init(dev, TRUE);
+2 -1
drivers/net/pcmcia/3c589_cs.c
··· 39 39 #include <linux/if_arp.h> 40 40 #include <linux/ioport.h> 41 41 #include <linux/bitops.h> 42 + #include <linux/jiffies.h> 42 43 43 44 #include <pcmcia/cs_types.h> 44 45 #include <pcmcia/cs.h> ··· 797 796 media = inw(ioaddr+WN4_MEDIA) & 0xc810; 798 797 799 798 /* Ignore collisions unless we've had no irq's recently */ 800 - if (jiffies - lp->last_irq < HZ) { 799 + if (time_before(jiffies, lp->last_irq + HZ)) { 801 800 media &= ~0x0010; 802 801 } else { 803 802 /* Try harder to detect carrier errors */
+2 -1
drivers/net/ppp_async.c
··· 30 30 #include <linux/ppp_channel.h> 31 31 #include <linux/spinlock.h> 32 32 #include <linux/init.h> 33 + #include <linux/jiffies.h> 33 34 #include <asm/uaccess.h> 34 35 #include <asm/string.h> 35 36 ··· 571 570 * character if necessary. 572 571 */ 573 572 if (islcp || flag_time == 0 574 - || jiffies - ap->last_xmit >= flag_time) 573 + || time_after_eq(jiffies, ap->last_xmit + flag_time)) 575 574 *buf++ = PPP_FLAG; 576 575 ap->last_xmit = jiffies; 577 576 fcs = PPP_INITFCS;
+3 -2
drivers/net/seeq8005.c
··· 46 46 #include <linux/etherdevice.h> 47 47 #include <linux/skbuff.h> 48 48 #include <linux/bitops.h> 49 + #include <linux/jiffies.h> 49 50 50 51 #include <asm/system.h> 51 52 #include <asm/io.h> ··· 700 699 int ioaddr = dev->base_addr; 701 700 int status = inw(SEEQ_STATUS); 702 701 int transmit_ptr = 0; 703 - int tmp; 702 + unsigned long tmp; 704 703 705 704 if (net_debug>4) { 706 705 printk("%s: send 0x%04x\n",dev->name,length); ··· 725 724 726 725 /* drain FIFO */ 727 726 tmp = jiffies; 728 - while ( (((status=inw(SEEQ_STATUS)) & SEEQSTAT_FIFO_EMPTY) == 0) && (jiffies - tmp < HZ)) 727 + while ( (((status=inw(SEEQ_STATUS)) & SEEQSTAT_FIFO_EMPTY) == 0) && time_before(jiffies, tmp + HZ)) 729 728 mb(); 730 729 731 730 /* doit ! */
+2 -1
drivers/net/shaper.c
··· 83 83 #include <linux/if_arp.h> 84 84 #include <linux/init.h> 85 85 #include <linux/if_shaper.h> 86 + #include <linux/jiffies.h> 86 87 87 88 #include <net/dst.h> 88 89 #include <net/arp.h> ··· 169 168 /* 170 169 * Queue over time. Spill packet. 171 170 */ 172 - if(SHAPERCB(skb)->shapeclock-jiffies > SHAPER_LATENCY) { 171 + if(time_after(SHAPERCB(skb)->shapeclock,jiffies + SHAPER_LATENCY)) { 173 172 dev_kfree_skb(skb); 174 173 shaper->stats.tx_dropped++; 175 174 } else
+2 -1
drivers/net/tokenring/lanstreamer.c
··· 122 122 #include <linux/spinlock.h> 123 123 #include <linux/version.h> 124 124 #include <linux/bitops.h> 125 + #include <linux/jiffies.h> 125 126 126 127 #include <net/checksum.h> 127 128 ··· 513 512 514 513 while (!((readw(streamer_mmio + SISR)) & SISR_SRB_REPLY)) { 515 514 msleep_interruptible(100); 516 - if (jiffies - t > 40 * HZ) { 515 + if (time_after(jiffies, t + 40 * HZ)) { 517 516 printk(KERN_ERR 518 517 "IBM PCI tokenring card not responding\n"); 519 518 release_region(dev->base_addr, STREAMER_IO_SPACE);
+5 -4
drivers/net/tokenring/olympic.c
··· 100 100 #include <linux/pci.h> 101 101 #include <linux/spinlock.h> 102 102 #include <linux/bitops.h> 103 + #include <linux/jiffies.h> 103 104 104 105 #include <net/checksum.h> 105 106 ··· 308 307 t=jiffies; 309 308 while((readl(olympic_mmio+BCTL)) & BCTL_SOFTRESET) { 310 309 schedule(); 311 - if(jiffies-t > 40*HZ) { 310 + if(time_after(jiffies, t + 40*HZ)) { 312 311 printk(KERN_ERR "IBM PCI tokenring card not responding.\n"); 313 312 return -ENODEV; 314 313 } ··· 360 359 t=jiffies; 361 360 while (!readl(olympic_mmio+CLKCTL) & CLKCTL_PAUSE) { 362 361 schedule() ; 363 - if(jiffies-t > 2*HZ) { 362 + if(time_after(jiffies, t + 2*HZ)) { 364 363 printk(KERN_ERR "IBM Cardbus tokenring adapter not responsing.\n") ; 365 364 return -ENODEV; 366 365 } ··· 374 373 t=jiffies; 375 374 while(!((readl(olympic_mmio+SISR_RR)) & SISR_SRB_REPLY)) { 376 375 schedule(); 377 - if(jiffies-t > 15*HZ) { 376 + if(time_after(jiffies, t + 15*HZ)) { 378 377 printk(KERN_ERR "IBM PCI tokenring card not responding.\n"); 379 378 return -ENODEV; 380 379 } ··· 520 519 olympic_priv->srb_queued=0; 521 520 break; 522 521 } 523 - if ((jiffies-t) > 10*HZ) { 522 + if (time_after(jiffies, t + 10*HZ)) { 524 523 printk(KERN_WARNING "%s: SRB timed out. \n",dev->name) ; 525 524 olympic_priv->srb_queued=0; 526 525 break ;
+2 -1
drivers/net/tulip/pnic.c
··· 16 16 17 17 #include <linux/kernel.h> 18 18 #include <linux/pci.h> 19 + #include <linux/jiffies.h> 19 20 #include "tulip.h" 20 21 21 22 ··· 69 68 */ 70 69 if (tulip_media_cap[dev->if_port] & MediaIsMII) 71 70 return; 72 - if (! tp->nwayset || jiffies - dev->trans_start > 1*HZ) { 71 + if (! tp->nwayset || time_after(jiffies, dev->trans_start + 1*HZ)) { 73 72 tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff); 74 73 iowrite32(tp->csr6, ioaddr + CSR6); 75 74 iowrite32(0x30, ioaddr + CSR12);
+2 -2
drivers/net/wireless/strip.c
··· 112 112 #include <linux/ip.h> 113 113 #include <linux/tcp.h> 114 114 #include <linux/time.h> 115 - 115 + #include <linux/jiffies.h> 116 116 117 117 /************************************************************************/ 118 118 /* Useful structures and definitions */ ··· 1569 1569 del_timer(&strip_info->idle_timer); 1570 1570 1571 1571 1572 - if (jiffies - strip_info->pps_timer > HZ) { 1572 + if (time_after(jiffies, strip_info->pps_timer + HZ)) { 1573 1573 unsigned long t = jiffies - strip_info->pps_timer; 1574 1574 unsigned long rx_pps_count = (strip_info->rx_pps_count * HZ * 8 + t / 2) / t; 1575 1575 unsigned long tx_pps_count = (strip_info->tx_pps_count * HZ * 8 + t / 2) / t;
+4 -3
drivers/net/zorro8390.c
··· 27 27 #include <linux/netdevice.h> 28 28 #include <linux/etherdevice.h> 29 29 #include <linux/zorro.h> 30 + #include <linux/jiffies.h> 30 31 31 32 #include <asm/system.h> 32 33 #include <asm/irq.h> ··· 152 151 z_writeb(z_readb(ioaddr + NE_RESET), ioaddr + NE_RESET); 153 152 154 153 while ((z_readb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0) 155 - if (jiffies - reset_start_time > 2*HZ/100) { 154 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 156 155 printk(KERN_WARNING " not found (no reset ack).\n"); 157 156 return -ENODEV; 158 157 } ··· 274 273 275 274 /* This check _should_not_ be necessary, omit eventually. */ 276 275 while ((z_readb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0) 277 - if (jiffies - reset_start_time > 2*HZ/100) { 276 + if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 278 277 printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n", 279 278 dev->name); 280 279 break; ··· 401 400 dma_start = jiffies; 402 401 403 402 while ((z_readb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0) 404 - if (jiffies - dma_start > 2*HZ/100) { /* 20ms */ 403 + if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 405 404 printk(KERN_ERR "%s: timeout waiting for Tx RDC.\n", 406 405 dev->name); 407 406 zorro8390_reset_8390(dev);