Skip to content

Commit

Permalink
e1000: Use time_after() for time comparison
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Manuel Schölling authored and Jeff Kirsher committed Jun 4, 2014
1 parent c46d150 commit 1aa65f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/intel/e1000/e1000_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1aa65f4

Please sign in to comment.