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


Use of the time_after_eq() 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>

---
 ns83820.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Index: quilt/drivers/net/ns83820.c
===================================================================
--- quilt.orig/drivers/net/ns83820.c
+++ quilt/drivers/net/ns83820.c
@@ -116,6 +116,7 @@
 #include <linux/ethtool.h>
 #include <linux/timer.h>
 #include <linux/if_vlan.h>
+#include <linux/jiffies.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -1610,7 +1611,7 @@ static void ns83820_run_bist(struct net_
 {
 	struct ns83820 *dev = PRIV(ndev);
 	int timed_out = 0;
-	long start;
+	unsigned long start;
 	u32 status;
 	int loops = 0;
 
@@ -1628,7 +1629,7 @@ static void ns83820_run_bist(struct net_
 			break;
 		if (status & fail)
 			break;
-		if ((jiffies - start) >= HZ) {
+		if (time_after_eq(jiffies, start + HZ)) {
 			timed_out = 1;
 			break;
 		}
