提交 788bfe88 编写于 作者: A Asaf Vertz 提交者: Greg Kroah-Hartman

usb: host: max3421-hcd: use time_after()

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: NAsaf Vertz <asaf.vertz@tandemg.com>
Acked-by: NDavid Mosberger <davidm@egauge.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5efd2ea8
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
* single thread (max3421_spi_thread). * single thread (max3421_spi_thread).
*/ */
#include <linux/jiffies.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/usb.h> #include <linux/usb.h>
...@@ -1291,7 +1292,7 @@ max3421_handle_irqs(struct usb_hcd *hcd) ...@@ -1291,7 +1292,7 @@ max3421_handle_irqs(struct usb_hcd *hcd)
char sbuf[16 * 16], *dp, *end; char sbuf[16 * 16], *dp, *end;
int i; int i;
if (jiffies - last_time > 5*HZ) { if (time_after(jiffies, last_time + 5*HZ)) {
dp = sbuf; dp = sbuf;
end = sbuf + sizeof(sbuf); end = sbuf + sizeof(sbuf);
*dp = '\0'; *dp = '\0';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册