e1000: Use time_after() for time comparison
authorManuel Schölling <manuel.schoelling@gmx.de>
Fri, 23 May 2014 18:04:17 +0000 (18:04 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 4 Jun 2014 06:58:06 +0000 (23:58 -0700)
To be future-proof and for better readability the time comparisons are modified
to use time_after() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000/e1000_ethtool.c

index 341889a4ef7f93f76fb4d845a592f015f7bd2d70..08b207df1459af9374365ac31d9a2ce18642040b 100644 (file)
@@ -1460,7 +1460,8 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
                         * 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(time + 20, jiffies));
+
                if (good_cnt != 64) {
                        ret_val = 13; /* ret_val is the same as mis-compare */
                        break;