]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
usb: host: max3421-hcd: use time_after()
authorAsaf Vertz <asaf.vertz@tandemg.com>
Mon, 15 Dec 2014 07:22:07 +0000 (09:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jan 2015 19:37:18 +0000 (11:37 -0800)
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>
drivers/usb/host/max3421-hcd.c

index 6234c75da33fa3a3d50f1ef173b9c5a7a7db9ca5..aaaff947d608763940a321b09740866630930519 100644 (file)
@@ -55,6 +55,7 @@
  * single thread (max3421_spi_thread).
  */
 
+#include <linux/jiffies.h>
 #include <linux/module.h>
 #include <linux/spi/spi.h>
 #include <linux/usb.h>
@@ -1291,7 +1292,7 @@ max3421_handle_irqs(struct usb_hcd *hcd)
                char sbuf[16 * 16], *dp, *end;
                int i;
 
-               if (jiffies - last_time > 5*HZ) {
+               if (time_after(jiffies, last_time + 5*HZ)) {
                        dp = sbuf;
                        end = sbuf + sizeof(sbuf);
                        *dp = '\0';