* [PATCH] hid: use time_after_eq() instead of jiffies judgment
@ 2022-02-10 8:30 Qing Wang
0 siblings, 0 replies; only message in thread
From: Qing Wang @ 2022-02-10 8:30 UTC (permalink / raw)
To: Srinivas Pandruvada, Jiri Kosina, Benjamin Tissoires,
linux-input, linux-kernel
Cc: Wang Qing
From: Wang Qing <wangqing@vivo.com>
It is better to use time_xxx() directly instead of jiffies judgment
for understanding.
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
drivers/hid/intel-ish-hid/ipc/ipc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c
index 8ccb246..15e1423
--- a/drivers/hid/intel-ish-hid/ipc/ipc.c
+++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-10 8:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 8:30 [PATCH] hid: use time_after_eq() instead of jiffies judgment Qing Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).