diff options
author | Asaf Vertz <asaf.vertz@tandemg.com> | 2014-12-15 02:22:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 14:37:18 -0500 |
commit | 788bfe88d552b89842b028ca78e5451a1e64b21b (patch) | |
tree | e0ed2f1078d95e72ded96c1838ebbb7de55ac2f2 | |
parent | 5efd2ea8c9f4f12916ffc8ba636792ce052f6911 (diff) |
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: Asaf Vertz <asaf.vertz@tandemg.com>
Acked-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/max3421-hcd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c index 6234c75da33f..aaaff947d608 100644 --- a/drivers/usb/host/max3421-hcd.c +++ b/drivers/usb/host/max3421-hcd.c | |||
@@ -55,6 +55,7 @@ | |||
55 | * single thread (max3421_spi_thread). | 55 | * single thread (max3421_spi_thread). |
56 | */ | 56 | */ |
57 | 57 | ||
58 | #include <linux/jiffies.h> | ||
58 | #include <linux/module.h> | 59 | #include <linux/module.h> |
59 | #include <linux/spi/spi.h> | 60 | #include <linux/spi/spi.h> |
60 | #include <linux/usb.h> | 61 | #include <linux/usb.h> |
@@ -1291,7 +1292,7 @@ max3421_handle_irqs(struct usb_hcd *hcd) | |||
1291 | char sbuf[16 * 16], *dp, *end; | 1292 | char sbuf[16 * 16], *dp, *end; |
1292 | int i; | 1293 | int i; |
1293 | 1294 | ||
1294 | if (jiffies - last_time > 5*HZ) { | 1295 | if (time_after(jiffies, last_time + 5*HZ)) { |
1295 | dp = sbuf; | 1296 | dp = sbuf; |
1296 | end = sbuf + sizeof(sbuf); | 1297 | end = sbuf + sizeof(sbuf); |
1297 | *dp = '\0'; | 1298 | *dp = '\0'; |