提交 1aa65f4d 编写于 作者: M Manuel Schölling 提交者: Jeff Kirsher

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: NManuel Schölling <manuel.schoelling@gmx.de>
Tested-by: NAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 c46d1504
...@@ -1460,7 +1460,8 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) ...@@ -1460,7 +1460,8 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
* enough time to complete the receives, if it's * enough time to complete the receives, if it's
* exceeded, break and error off * 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) { if (good_cnt != 64) {
ret_val = 13; /* ret_val is the same as mis-compare */ ret_val = 13; /* ret_val is the same as mis-compare */
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册