Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3375891pxb; Thu, 10 Feb 2022 20:25:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLBTtTBr6H7jEo0D+Ndy+EMkObSpam3ClmCI5N3dVTCumcwYHXr82Gapy1KD4Bmcvq6st3 X-Received: by 2002:a17:906:518b:: with SMTP id y11mr9044792ejk.302.1644553542926; Thu, 10 Feb 2022 20:25:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644553542; cv=pass; d=google.com; s=arc-20160816; b=syfz5rxkkFoCmUqZjkL8n0szFinp8DMlkjfDdlM/HvBVN8KVa436W+aR/rknRWArR8 c1pc+6uM72FlvQIVPSh9aqaxrbdxbcKMA9YE0t3nvAFT7M2tSKk06pGAOii0heThXnYm QIa1RvAbtE4Z5uchPX7aHu09fawntn+OcoUqVwxNY56f1WnZ+PzQGxeQzF7MexcIIMxs gTsAqxXvKhRu7a+VhfEzLhE19fTtbKGxknSktVaHJPEjtAwnscdoCmZ86uFIBFuiea+5 G+OEWHY3iCRF7HrdEHVEhK53cvRflp2MKHelTt10kUsq+5jlyXd9PrbSwSxMyDcciZFG jhpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=AJmrL/wszRwZlM8YVbrQxGpNSgXK6M6vSTblQPIFMZk=; b=QxdWZ08gy8VMNMxWk2rc9W2MkMlspHpMxfGHcLslsp7MMgeLwVPXeOcsw5dHljK4Zj a0z1w4lVL1To4fT5KmSCyWqc3DsgOOWESq+f6GrdPHxfASTMRt4yTp2Bigwz3YFIGbE3 DPqQjMDG63WRzjshXTLkPa9PSQmr2j7K7N7EkMJkK0wLVD4zroXYUPW5No2PPjNmnefm H41mpAeeLOSak9HfVHTcAHnm3E7XC13HwqiB/QlizZDUlH7L5gDHq5ZQ4ZF1ybNMKySF d4hqjGyovDv4I0TAWmr+LOH1VtQDsJ5PTv6FgEI4gsDRoZKyXHSyCeM7yMu1uwGm45e0 9caA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=LDllR3II; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm15si9820936edb.316.2022.02.10.20.24.53; Thu, 10 Feb 2022 20:25:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=LDllR3II; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347414AbiBKCcJ (ORCPT + 99 others); Thu, 10 Feb 2022 21:32:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244143AbiBKCcH (ORCPT ); Thu, 10 Feb 2022 21:32:07 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2092.outbound.protection.outlook.com [40.107.255.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 956935FBF; Thu, 10 Feb 2022 18:32:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hIfy3zPFMEbsGtSoSPPqbkeOZ/dLOYRhHpUAR5suGf0g13wWkXMBPST8Fhr6n/7cQw5DqX2AdL7hqO2geNXWARmpnRgvAaRXQ/b9VHLTMT8tFEIbPQnJ+qjBY0dhfBHqH/WEA3Jujet6Vqxhxo4ASGgUua+3W2YMZgdME8yLHeHNXszr8EkJZCsegRjL4m4Rrf2hzfQJXoKAzUn2Nziou+RKBQTUIjeWmLStwmtLIoriEyWVYLjFFz+JtfaJE6Yb1fvTU3haZeC0UzG/kJdWGiXtFbCnLk34hPB/ZaevsLKWne/VXoBsxKEaF19bgjwJNc1QD8CB/XAu1TEuuXdT8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AJmrL/wszRwZlM8YVbrQxGpNSgXK6M6vSTblQPIFMZk=; b=fZLtPnmelz9hHT+SBLwremtvuxlBf/i97duKgdlLicJMapgsGYxkM7ekYio7Pqs2xqalvaWb4a4PPyY6ePuE46T+6ECgZEg7AQPNZeiW410j8/dtomsvKjD3vfQIBxHdIFYI6CvJ0HDNZHApXCu+E8yxgvBJg4q5sNHXPw8HaXSTcCff7VQA/oPNpMgyeU0YW9nTl9KFgXwKNJOKiQU98yjlcsPcKdnafBe/Q+9lGFt45RQVyvI7yLjBrl3xGWLMxNeFahRxuyFQDtpEzF4Z/lTa4P0ARmevDbfyt9Wn2JwOJ0Ncn93UcBRzHU2abDTvZSvgJCmVDFnPL8kOP+Y64A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AJmrL/wszRwZlM8YVbrQxGpNSgXK6M6vSTblQPIFMZk=; b=LDllR3IILBHFO0J/aZBfYXz5fNvlV220gcDU3SWKf+HU7oHuWzU/dB0FR2LJfl/dYcSy8cqB31wWUe2Mb6FEIUq7uzbzVVCpg+g3myBOJgzqZwDq2/jtLrEXi7JxOgHSh2NqwPFlxkIDBzHxIi0wn+xWvRizEAh0w+V3IgMIFtU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by TY2PR06MB2895.apcprd06.prod.outlook.com (2603:1096:404:31::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Fri, 11 Feb 2022 02:32:05 +0000 Received: from SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::80b4:e787:47a9:41bb]) by SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::80b4:e787:47a9:41bb%4]) with mapi id 15.20.4975.014; Fri, 11 Feb 2022 02:32:05 +0000 From: Qing Wang To: Konrad Rzeszutek Wilk , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jens Axboe , Michael Turquette , Stephen Boyd , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires , 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, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org Cc: Wang Qing Subject: [PATCH V2 6/13] input: serio: use time_is_before_jiffies() instead of jiffies judgment Date: Thu, 10 Feb 2022 18:30:29 -0800 Message-Id: <1644546640-23283-7-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644546640-23283-1-git-send-email-wangqing@vivo.com> References: <1644546640-23283-1-git-send-email-wangqing@vivo.com> Content-Type: text/plain X-ClientProxiedBy: HK2PR02CA0178.apcprd02.prod.outlook.com (2603:1096:201:21::14) To SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d708849d-f73a-4f4d-cc35-08d9ed06b144 X-MS-TrafficTypeDiagnostic: TY2PR06MB2895:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Knvn+ZoyuwtwWjb9mcX7NX4jSd5sdfPjHKvVg0RXnl4B0HLfdv7nMLFc7oEB4uoAC7nhPliMSDWanEG6pMpbUMVchrTfRPtCpo+Y9i2hsRrc25VPJsQIlYgbOHynMgwohX+gOCxM98x/hcUkKTKy6Ryyhot4nSM/0df5459+EPX+x8NZu34ETQArWLJOO3DJoFyzdyDDJijXFnKF8StSK8SDk/KX6pxA24EhE4BsT7pE8nNubWPzCoKTJZ7vOov0foDGTTu6krh/sLcMo6L6nZ6nydKlrooia830KyO7n+KfO43/q8wgsu0A+JODt2HzqOlnx941h+brnfgGknRGrExAUXDCl8qIKFU0jeXg2oIM3raNNQXDgmZPJOmeMV9EhhTFBr5mgg1YOlGcDkX2Rx3CZfKwql7KkyvR7akXzIHPo3pC+7d2N4rU1kFHPBOq+rv1FrY2/QtW3a0t65ZNCOQDeECkSq5ewxwXJiYpN0ZKgFH1KLjT7ocJcx1ye2Mjkzh1io96S0XXVoxVwnFgltmxzN3tbxnfFLn3kP0Jnh9Sv4sKlzKr13KfQgEjlD66Y8FsDfp3Xp3FqQnn+hJ4WkYB0fL0fxaXSwDlsdL/R1zm5erAtH3JjL2OMueHjzOjBFj1hDM2oTVUQ3HXfriBYbSf4BBfNyfwfOv7LhlhMppZxHs0XurFN1SuOtP7wCSnfPcNMxU25l/4naC+SDZhkRhEnwSvc6XBS+HkJgo+XK7hZZGCTdgfdd8zaO/cYRS9 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SL2PR06MB3082.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(38100700002)(2906002)(316002)(110136005)(86362001)(6486002)(38350700002)(6506007)(6666004)(26005)(186003)(2616005)(6512007)(5660300002)(8676002)(7406005)(508600001)(36756003)(4326008)(8936002)(83380400001)(107886003)(921005)(52116002)(66556008)(66476007)(7416002)(66946007)(21314003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?j1JTYbUZFwE57rs9P/bZPsIXhEWUhUwZYslxJXmoBcB0DzYfbRs71yby+bz/?= =?us-ascii?Q?vz75e/QAd9pa2P700yMpBDdgLxzW6+5gs4C2NReUwTJLVy/jkasgGvEJEAMo?= =?us-ascii?Q?ANyh3VAVxDLRWeKzNgfmUh59OQ0gG7J78o38VzqvB2TASGOVv9JmA04H3jiz?= =?us-ascii?Q?VATIIQjKFAWUEX2zZraRVTaLYF/Kn/KwzMw+jry1qtD4Pk3NcNq3a9h8UVqa?= =?us-ascii?Q?zDvMEWaV6dI+Ps0UjvurBJ0po1LIa12Dn1BruvzU4WmY8X/Q2Sur9NeUloSc?= =?us-ascii?Q?8ccM0l5hQfo0YztFRCut2eaB6mWaG1NKEJ3KjWSsLKJU1ksTHAptEVL+jpRp?= =?us-ascii?Q?Qj7+D6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7IlfO7QKTINUY8e?= =?us-ascii?Q?dr/J825MBIGDIxE1ZIW2/lJoP+5aYqcAj4Mn9uwCazYon5CmGekCEjPpKYzI?= =?us-ascii?Q?/4U+1h5LnacScpbVRhSDZOhzC/nvAredJ67lub0o0a36TEg5zvNi9tugM5q0?= =?us-ascii?Q?F30Zr1Xo/YHair/UowF6j/fWerUeIUQhadUX7HZz3tJuCFj3rjerGRWG6qPW?= =?us-ascii?Q?q2OOJcB7iltVZ9HQI5GAo4/MsgPPdvQXOtXIVeT2fLFQeQwtp9m5ixLahLkT?= =?us-ascii?Q?IevJsLNjsAxF07GN1agDblRVNjIofefahuoICwB6CS/Vxns6d/Yqw/ibLnrt?= =?us-ascii?Q?Ve0p0IZq4Hz8+TRwiysYCTaru+5OfIlnMukaKBQz5hUy12PLehFXl8E6uVFv?= =?us-ascii?Q?uTbGOTOaM/sLAUWkpuhcXA0=3D?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d708849d-f73a-4f4d-cc35-08d9ed06b144 X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 02:32:05.1954 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AKip6f9iqiS3IpgYMeOPaufHSDL7O8bFVrZCqIKCGXNHOnl1Y+SvZVBj97LT3qYik6/RGDYwW2+DwZ8sR60wNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR06MB2895 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Wang Qing It is better to use time_xxx() directly instead of jiffies judgment for understanding. Signed-off-by: Wang Qing --- 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