]> git.baikalelectronics.ru Git - kernel.git/commitdiff
HID: intel-ish-hid: ipc: use time_before to replace "jiffies < a"
authorLi Qiong <liqiong@nfschina.com>
Mon, 6 Jun 2022 13:47:50 +0000 (21:47 +0800)
committerJiri Kosina <jkosina@suse.cz>
Wed, 8 Jun 2022 11:05:45 +0000 (13:05 +0200)
time_before deals with timer wrapping correctly.

Signed-off-by: Li Qiong <liqiong@nfschina.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/intel-ish-hid/ipc/ipc.c

index 8ccb246b0114a89ea1cf7db6795eda0a36c90516..15e14239af829bd7574b6440e4a5b097eaca893f 100644 (file)
@@ -578,7 +578,7 @@ static void _ish_sync_fw_clock(struct ishtp_device *dev)
        static unsigned long    prev_sync;
        uint64_t        usec;
 
-       if (prev_sync && jiffies - prev_sync < 20 * HZ)
+       if (prev_sync && time_before(jiffies, prev_sync + 20 * HZ))
                return;
 
        prev_sync = jiffies;