mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] HID: intel-ish-hid: ipc: use time_before to replace "jiffies < a"
@ 2022-06-06 13:47 Li Qiong
  2022-06-07 14:32 ` Pandruvada, Srinivas
  2022-06-08 11:06 ` Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Li Qiong @ 2022-06-06 13:47 UTC (permalink / raw)
  To: Srinivas Pandruvada, Jiri Kosina, Benjamin Tissoires, Pandruvada,
	Srinivas, Ye Xiang, Even Xu, Li Qiong
  Cc: linux-kernel, yuzhe, renyu, linux-input

time_before deals with timer wrapping correctly.

Signed-off-by: Li Qiong <liqiong@nfschina.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 8ccb246b0114..15e14239af82 100644
--- 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.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-08 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06 13:47 [PATCH 1/2] HID: intel-ish-hid: ipc: use time_before to replace "jiffies < a" Li Qiong
2022-06-07 14:32 ` Pandruvada, Srinivas
2022-06-08 11:06 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®