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 e4ebd7d..a8633b8 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;
                }