Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp470839iof; Mon, 6 Jun 2022 07:02:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHHjrAplRomaPQ7lUDBAE2SX+IRtVp9nNtz9vwQZPnnRFW1/NgIpCWh1mARaPmrwqsXOuH X-Received: by 2002:a17:90b:3a8f:b0:1e8:7669:8a2f with SMTP id om15-20020a17090b3a8f00b001e876698a2fmr8315286pjb.55.1654524128539; Mon, 06 Jun 2022 07:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654524128; cv=none; d=google.com; s=arc-20160816; b=tzfSnXlETbIIKdqsbzoSwKSRe/E6ObIEoalUv8JFRfhunOwtYNHIrh7E7F/46723SV EgDuLHNuZtIX3E8HG+yzS3uwr1gINdWpAmV1OxVCqC4nU9ifzRDp7Z1wyH8OvClgmLmG KBqx1q2UuVjkJTRP08LIaYoDtEWL2tznczmzrmED1HmNXe3RBKbIs7kJ0WaocSgVywb4 o2GlpyOtYCxpgF56lmv+eLUE0HVQ/17oFcQYXuLKJg3KXM7DnjWi8/twY6N0VBr6Uh7X bzusqXhDobOF+MRMyK1iYz4isR2OxwOF7t58GEIXDbFW9ys8dMXbfVXTdncSwSkJaNO/ fkDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=BmrKpTBvMleqsIf5HMMuQtwCEg1IEJVV2boKMMK6bJU=; b=WKCcUrM/q5zKeI2IWWvsDEOQFoR0Bn5wVkkkZLFc9dC+jo54jPosaSWqYrUrUdMHSk qBcOvcyFK/mSu7X0wz4rfr0RhuRsuboc6CNQ3l++bUtQHFRBqCzbs0urAJHqbZpR67nd 17ahbNL7PvYNnBjv1ccoRrTKcgZNsg5QTpaJ66k7d1c0/EYkoZnm2e4I62pFRqLyBZWG lp3VwuQHMLRY0qRTEdmZNSV81QzFI6m/SYWypQcDDAD/vM8DgZjPaPS9aUy73KMClb77 FPaaC/5hsY0Z8zLOTf6unhgYpxXYpc040LIIE5d5IzAZiVUdLClsMM42Mli0tcfw1ZDg agnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y5-20020a17090322c500b0015838a4fd9dsi22530030plg.64.2022.06.06.07.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 07:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA786A33A3; Mon, 6 Jun 2022 06:48:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239246AbiFFNsp (ORCPT + 99 others); Mon, 6 Jun 2022 09:48:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239234AbiFFNso (ORCPT ); Mon, 6 Jun 2022 09:48:44 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 911CB9EB52; Mon, 6 Jun 2022 06:48:42 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id CB56B1E80D76; Mon, 6 Jun 2022 21:48:30 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bqrMqcGi6c96; Mon, 6 Jun 2022 21:48:28 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 96AA61E80D27; Mon, 6 Jun 2022 21:48:27 +0800 (CST) From: Li Qiong To: Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires , Pandruvada@lists.nfsmail.com, Srinivas , Ye Xiang , Even Xu , Li Qiong Cc: linux-kernel@vger.kernel.org, yuzhe@nfschina.com, renyu@nfschina.com, linux-input@vger.kernel.org Subject: [PATCH 1/2] HID: intel-ish-hid: ipc: use time_before to replace "jiffies < a" Date: Mon, 6 Jun 2022 21:47:50 +0800 Message-Id: <20220606134750.20736-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org time_before deals with timer wrapping correctly. Signed-off-by: Li Qiong --- 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