From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Subject: [KJ] [PATCH] drivers/net/ne.c : Use of time_after() macro

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 <marcelo@feitoza.com.br>

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

Index: quilt/drivers/net/ne.c
===================================================================
--- quilt.orig/drivers/net/ne.c
+++ quilt/drivers/net/ne.c
@@ -50,6 +50,7 @@ static const char version2[] =
 #include <linux/delay.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/jiffies.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -339,7 +340,7 @@ static int __init ne_probe1(struct net_d
 		outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET);
 
 		while ((inb_p(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
-		if (jiffies - reset_start_time > 2*HZ/100) {
+		if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
 			if (bad_card) {
 				printk(" (warning: no reset ack)");
 				break;
@@ -574,7 +575,7 @@ static void ne_reset_8390(struct net_dev
 
 	/* This check _should_not_ be necessary, omit eventually. */
 	while ((inb_p(NE_BASE+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;
 		}
@@ -781,7 +782,7 @@ retry:
 #endif
 
 	while ((inb_p(nic_base + 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_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
 			ne_reset_8390(dev);
 			NS8390_init(dev,1);
