Skip to contentSkip to conversation

drivers/net/e1000/e1000_ethtool.c : Use of the

PATCH New Marcelo Feitoza Parisi 1 participant 1 message Jul 16, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/e1000/e1000_ethtool.c : Use of the

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.

drivers/net/e1000/e1000_ethtool.c +3 -2
@@ -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;
 		}

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors