All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/net/e1000/e1000_ethtool.c : Use of the
@ 2005-07-16  7:08 Marcelo Feitoza Parisi
  0 siblings, 0 replies; only message in thread
From: Marcelo Feitoza Parisi @ 2005-07-16  7:08 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: e1000_ethtool.patch --]
[-- Type: text/x-patch, Size: 980 bytes --]

Use of the time_after() and time_after_eq()  macros, 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>

--- linux/drivers/net/e1000/e1000_ethtool.c	2005-07-13 17:52:19.000000000 -0300
+++ linux-kj/drivers/net/e1000/e1000_ethtool.c	2005-07-15 23:51:00.719718560 -0300
@@ -30,6 +30,7 @@
 
 #include "e1000.h"
 
+#include <linux/jiffies.h>
 #include <asm/uaccess.h>
 
 extern char e1000_driver_name[];
@@ -1389,12 +1390,12 @@
 			 * enough time to complete the receives, if it's 
 			 * exceeded, break and error off
 			 */
-		} while (good_cnt < 64 && jiffies < (time + 20));
+		} while (good_cnt < 64 && time_after(jiffies, time + 20));
 		if(good_cnt != 64) {
 			ret_val = 13; /* ret_val is the same as mis-compare */
 			break; 
 		}
-		if(jiffies >= (time + 2)) {
+		if(time_after_eq(jiffies, time + 2)) {
 			ret_val = 14; /* error code for time out error */
 			break;
 		}

[-- Attachment #3: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-16  7:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16  7:08 [KJ] [PATCH] drivers/net/e1000/e1000_ethtool.c : Use of the Marcelo Feitoza Parisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.