Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2415555iof; Wed, 8 Jun 2022 04:38:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAWGo+2KrwaFBnju2d8Iyt/And3ogNCIf7u3Js1SN0BcCv/SDtjwKBJWCyB/7vJDcB2mXz X-Received: by 2002:a17:90b:1d90:b0:1e8:5a98:d591 with SMTP id pf16-20020a17090b1d9000b001e85a98d591mr23284640pjb.126.1654688328333; Wed, 08 Jun 2022 04:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654688328; cv=none; d=google.com; s=arc-20160816; b=YbSuk4Zp3umO/EN5zJr+2XXaIruX0suPeaGojWT7R4x1uB5rUZ8/FXfN8JsRwOPxnH HBVsLHbvoMYbKDJIdmPZpj9oTRF5Z1yf9j323213LPSe6XqUEgSeTVI+sUc1xDkUkZi+ /WEK7xl9lWfL2JeADrkFTSdcDzgsdg0+da+MkaENtW0+o9yekweHUa7j/YdZj1PJrCZU bO4ZPqnq8dJXh8Jg+n+WiFCaOsR9NuMTZPw/5bVvRRcd2AaQEd4UUBEIQFrxaw7Rvf8n v6ocy7HOthiHgFdWUP2hzjKc8Dq+Ne2DJ93d6PA0Pi9rrsWpLj6ojm68B0QYVLK0Dyil 9+Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=/flrwMhuJP0z8ZQCoq5lx2mfIz+Q/a8WY5cuZKs7jJk=; b=Egt9yMFB40FinrUJxIfKKzNjmDBrX8GdXNH6cB8XSIai/Ryo1xppP1f5iFTgAxqPat Q2gaAa7NVKUXV2OFuKCpOnEIIajbiFnM0G3m6HUt+KblwVpa/SfwZSlxD+5N3BmWtU5Z phRXEvddvKQbHFxXhYElJ46v6LkPjTMQXrljbNasZ4d0I1E0tD0nXM7u4vROEwFWLJXk gSanCgGUfbk90NO0XqRCB0xVhR1ap+7LStaKr2KrNdYs5AzPRaQyEMp/jmCrPEvU+xka 45GFnMISeuxa+EH/ThoNWYa8AMzBbjNK3kjecwHPMGAkFmf96tYzVUFwTJFzEU4foxM9 GXeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VpF084q5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u17-20020a170902e5d100b0016646a4d661si63845plf.377.2022.06.08.04.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 04:38:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VpF084q5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 59879100B01; Wed, 8 Jun 2022 04:06:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237724AbiFHLGX (ORCPT + 99 others); Wed, 8 Jun 2022 07:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233907AbiFHLGV (ORCPT ); Wed, 8 Jun 2022 07:06:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE43617ED23; Wed, 8 Jun 2022 04:06:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 76D0961225; Wed, 8 Jun 2022 11:06:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98324C34116; Wed, 8 Jun 2022 11:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654686378; bh=B7KiNiEUm0hM3MxGWL8mWf3tXwJKwloCq7rFvO2y/LM=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=VpF084q5yRR8y6kSx8weSz0Dm+n2J0qh4FXhuBsX/OR17q1b/RdumQIrCIWMXZ/4D v8BNS0GIq5Q3qLKFzByhCxl6Se0INGev4dA37TQLAyWCG6UGiiYAvENiPOw/7HIyb2 iKBLAxGg9spWF766IWjVmFO2/pGGX5srTDGCxszX9VdBXLRv8dqz1RURKsOD0qPHE0 tzfnGG9ZIMWvDkT3iltLB6cJRWHmMdHgmGLvVC4A803MHihnpWrKyiJTyK7AkBmcid saBxoPENltJO2FTVujmAEqK6CVPs6ltcCfs4uiLOWQCa9hbabduGUA9ot2w9PjUnwg 7YkGV5ZB6sNvg== Date: Wed, 8 Jun 2022 13:06:14 +0200 (CEST) From: Jiri Kosina To: Li Qiong cc: Srinivas Pandruvada , Benjamin Tissoires , Pandruvada@lists.nfsmail.com, Srinivas , Ye Xiang , Even Xu , linux-kernel@vger.kernel.org, yuzhe@nfschina.com, renyu@nfschina.com, linux-input@vger.kernel.org Subject: Re: [PATCH 1/2] HID: intel-ish-hid: ipc: use time_before to replace "jiffies < a" In-Reply-To: <20220606134750.20736-1-liqiong@nfschina.com> Message-ID: References: <20220606134750.20736-1-liqiong@nfschina.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Mon, 6 Jun 2022, Li Qiong wrote: > 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; Applied, thanks. -- Jiri Kosina SUSE Labs