Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aa65f4d authored by Manuel Schölling's avatar Manuel Schölling Committed by Jeff Kirsher
Browse files

e1000: Use time_after() for time comparison



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: default avatarManuel Schölling <manuel.schoelling@gmx.de>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent c46d1504
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;