e1000e: resolve checkpatch JIFFIES_COMPARISON warning
authorBruce Allan <bruce.w.allan@intel.com>
Thu, 15 Aug 2013 03:43:24 +0000 (03:43 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 22 Aug 2013 09:33:24 +0000 (02:33 -0700)
WARNING:JIFFIES_COMPARISON: Comparing jiffies is almost always wrong;
prefer time_after, time_before and friends

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000e/ethtool.c

index e4ebd7ddf5f2e42a7ea2e214022eabab8d95b114..a8633b8f0ac5aaff57b2be97d8e0ac5dfe3ff36a 100644 (file)
@@ -1665,7 +1665,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
                        ret_val = 13;   /* ret_val is the same as mis-compare */
                        break;
                }
-               if (jiffies >= (time + 20)) {
+               if (time_after(jiffies, time + 20)) {
                        ret_val = 14;   /* error code for time out error */
                        break;
                }