Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp590562pxb; Tue, 15 Feb 2022 23:05:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbxbqwb3fQvSAX+jw6UZsTPeCM8BgS7XyYuDxTdS2lAYsHYwDfc8jSFwiEqmHVoU4CyCOd X-Received: by 2002:a17:90b:ec2:b0:1b9:cdb6:3787 with SMTP id gz2-20020a17090b0ec200b001b9cdb63787mr212245pjb.65.1644995104265; Tue, 15 Feb 2022 23:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644995104; cv=none; d=google.com; s=arc-20160816; b=LZZfH/IXnVmwnMq1o38ffuUZEaBgS6l/dFq/R5Bwll5dVwqi3aT6qZ/TCFLpHSKCsC nrQfxmFR8nJzeyxNE1S/lXPcTjTo/3sSUjGW/tFSCH95epO8vGyOLeVOBxT0ZrnhCTTG 3msGTr1wGXW3UqmvFijpDlC9SOYUWFD5h5hs4Bh/mL7pgGEoT/Vaqzw1uV2x/FeoNOmI P5aAfw+/gwkzwa4Q67BowNyxxfGyMI3KcaqY5AD2CQ+gTHExxe0CFCosb81Msk5ZFhdl GY4Ow/PPeCM7R7EGusjCwaFoCLLBMFtKDaf3uN4HWFqwxWflQxwsdnwF5Ewr5s8Xj5Bw MANA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cAghCw6nMXIP8DbPC2ZTmMjVdzgtfdV0Q4rDuIo9NkY=; b=UvsBvAuqPRvd+vzMpX128g9IRR9gTGeS7l8Gccm2lnysBgQV4/YSQXENAfitVeySJz zsQOOt/zuNy06jSGgecOSK2OeuG6WQL2UGxiwD0/G9VnqFDQoh9kLu35M0JgGqEcjUUK FvI4JjFvGdVSdfTLiTTO4bEkL2C0nQX+3vVymSNQwrIO2DHXsSLE0swJ0RXceHzO5ofs sd2lAscACjSyYNkzo8hKyBcFX1/6k03/6ZbGNRFxQCjP4DYEsPaXXLhTGnVerBwC/E+C zl9XWqStdlLcvN63upL7Ww53ZTFTt++3z5KAPMwjp/uzGk4MsbaGI2aQ2yT7+ZPT6rYI U5+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DSqmbLSA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id hk18si6628049pjb.183.2022.02.15.23.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:05:04 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DSqmbLSA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8A894A9A4C; Tue, 15 Feb 2022 22:42:31 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234878AbiBOIsv (ORCPT + 99 others); Tue, 15 Feb 2022 03:48:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234264AbiBOIst (ORCPT ); Tue, 15 Feb 2022 03:48:49 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3978A1133E9 for ; Tue, 15 Feb 2022 00:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644914919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cAghCw6nMXIP8DbPC2ZTmMjVdzgtfdV0Q4rDuIo9NkY=; b=DSqmbLSAwCAJVngxiscPK3AI83fBvtKyU1g0AilU1+5l1HWqSms+MFHSUGa0sZO/SfGwjz MTARKord6OnXu1SikYooOuoDXp45WeVwP+NSyH7Y/dELylzZWdS76PxZnMHKfa6/B5mtm0 Kk9NNo2FFnT7z/6lrYWi3bCEQd9gsF4= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-147-MlmkDwvaNyudVl2pQgNM_Q-1; Tue, 15 Feb 2022 03:48:36 -0500 X-MC-Unique: MlmkDwvaNyudVl2pQgNM_Q-1 Received: by mail-pj1-f72.google.com with SMTP id ml24-20020a17090b361800b001b8877a4b6eso12680395pjb.5 for ; Tue, 15 Feb 2022 00:48:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cAghCw6nMXIP8DbPC2ZTmMjVdzgtfdV0Q4rDuIo9NkY=; b=eB3/0A9/kkaRYwqJzPb5crxwG0yPMjEu4uBfPOfnHAQ00ZIu4V9KDVFXCx8jUwnM3x leQLRJBdqAQfiaiFyEmNUfZYam5oie51wWMtkDFT9nZeGYC3LxzPoRKfLeAeeY5Y/iW+ dWO8cbqIH0RePIMCviQZPYLEvFar940KpFr6ijfAcL9bt6NNuSoSdPqBVG8x4aIcDc6d p8YKxNWyThbdcvrwgILf97wK5aq9i5UfaTav6DdYz3IlKRCQ7KkDcm+eezNUz5wNNSai YPXbnacQeyAig2W0g62mYtB28b5Thp51Sl6E/IyDSUjjqoB955LbLhuVSTBwMHAjDa6W dI0w== X-Gm-Message-State: AOAM533oaI9z1WYKqtR0k3sw2xb4zM4T2TxealUVq6BliWr66FCsk4Wc u1HwiDjdXhkKjdfAQ2kQOLJBQhNddFCkkEmLu6B7uTo9HR1moIyDOoV5YJo9d4P06mSOeWzn+z0 4mzwMkkovNDr8aRNiWQXYJaAoYEXEWU9XsU0K+gK4 X-Received: by 2002:a63:2bc5:: with SMTP id r188mr2644614pgr.363.1644914915613; Tue, 15 Feb 2022 00:48:35 -0800 (PST) X-Received: by 2002:a63:2bc5:: with SMTP id r188mr2644575pgr.363.1644914915393; Tue, 15 Feb 2022 00:48:35 -0800 (PST) MIME-Version: 1.0 References: <1644890154-64915-1-git-send-email-wangqing@vivo.com> <1644890154-64915-7-git-send-email-wangqing@vivo.com> In-Reply-To: <1644890154-64915-7-git-send-email-wangqing@vivo.com> From: Benjamin Tissoires Date: Tue, 15 Feb 2022 09:48:24 +0100 Message-ID: Subject: Re: [PATCH V3 6/13] input: serio: use time_is_before_jiffies() instead of open coding it To: Qing Wang Cc: Konrad Rzeszutek Wilk , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Jens Axboe , Michael Turquette , Stephen Boyd , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , Srinivas Pandruvada , Jiri Kosina , Dmitry Torokhov , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Mauro Carvalho Chehab , Hans Verkuil , xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, lkml , linux-clk@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, "open list:HID CORE LAYER" , linux-media@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 On Tue, Feb 15, 2022 at 2:57 AM Qing Wang wrote: > > From: Wang Qing > > Use the helper function time_is_{before,after}_jiffies() to improve > code readability. > > Signed-off-by: Wang Qing > --- Reviewed-by: Benjamin Tissoires Cheers, Benjamin > drivers/input/serio/ps2-gpio.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c > index 8970b49..7834296 > --- a/drivers/input/serio/ps2-gpio.c > +++ b/drivers/input/serio/ps2-gpio.c > @@ -136,7 +136,7 @@ static irqreturn_t ps2_gpio_irq_rx(struct ps2_gpio_data *drvdata) > if (old_jiffies == 0) > old_jiffies = jiffies; > > - if ((jiffies - old_jiffies) > usecs_to_jiffies(100)) { > + if (time_is_before_jiffies(old_jiffies + usecs_to_jiffies(100))) { > dev_err(drvdata->dev, > "RX: timeout, probably we missed an interrupt\n"); > goto err; > @@ -237,7 +237,7 @@ static irqreturn_t ps2_gpio_irq_tx(struct ps2_gpio_data *drvdata) > if (old_jiffies == 0) > old_jiffies = jiffies; > > - if ((jiffies - old_jiffies) > usecs_to_jiffies(100)) { > + if (time_is_before_jiffies(old_jiffies + usecs_to_jiffies(100))) { > dev_err(drvdata->dev, > "TX: timeout, probably we missed an interrupt\n"); > goto err; > -- > 2.7.4 >