Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30215517rwd; Thu, 6 Jul 2023 02:36:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlFQJOzxAs1aEjouRjc1F2S0qU52opVTGfSIAP6invn15oXlteF80m7HE8godhu3x3yWBHSm X-Received: by 2002:a05:6358:7247:b0:134:c384:59dd with SMTP id i7-20020a056358724700b00134c38459ddmr1845254rwa.23.1688636177537; Thu, 06 Jul 2023 02:36:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688636177; cv=pass; d=google.com; s=arc-20160816; b=xOT2jLaYxEuo36iTUIy0bNIcsV2gWMst7S1u4DoBAr2H5n1DDHt2W32pcTLuyCr34W 1Hb04VKXMk+tX/hmL8HNn4WoYz05hg6c7tqQr13H9WiFTKwQ7UshSbw2Pmgm+Bxn9oCN NZ2p+oeDxDPXJmZBuY0wraaqI7+NuJApsy/WUXrF19yY6rI0e73QKIVY3SoTOtnCNZnB FhE5v22opJLMtwfIG1oVIfpvM0PLvsyap2nLIxv0u4hL1dPKN3h/bZiLLwuLvHhLer/A oswUD7Eg5hpsyZeCED9di1Zy5CbSZcz3y2QxpD7dm5qWb6KWy2lAuG7zcWW3UGs0KOJJ ozNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=TC40/Mk4pipYtQMPyX5G7aM5k75xPSo9LeZORXXwFLM=; fh=Fw/mjdvFXhLqDnV0FeYhazDLzXtdcRfAn98UOZZDgSA=; b=yrB7ILkSi8A2YzzelX4QDlbP8NbQn/rlzI6PVhOylUTnidgetUpIhLTCQ+X1Q+JKjg G+nYLFWDN0Q4TnwXB250HLXGlhOo+Lj1dA/EuDTgyvZHDaPJX7VHXcCkjV3t2ZU2xf50 ZBXFeZW+8A0YjXEIkIKF3D2WUdXaDwUlSIgRFr2WwgUPomF+pDHF9HUHrkrywk9rvYSu tiwoFQWjtJpHJnTwzoIH/OTkp+E6hkhUlJ/Q6HlfmPVA2o/kFq4n9UXVkcrgKs8S/NUe BUGFPyuOmAY1yb6XukC0p9+JZc9azJSNgH3hSRnrVkWRM9vNDeg8AF3m/9h+myUrL+3b qzbA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=YPpV2D6K; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=pass (p=QUARANTINE sp=QUARANTINE 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 q14-20020a056a00084e00b00666eb3ab9e3si1049469pfk.387.2023.07.06.02.36.03; Thu, 06 Jul 2023 02:36:17 -0700 (PDT) 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=@vivo.com header.s=selector2 header.b=YPpV2D6K; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231346AbjGFJQ3 (ORCPT + 99 others); Thu, 6 Jul 2023 05:16:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjGFJQ1 (ORCPT ); Thu, 6 Jul 2023 05:16:27 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2100.outbound.protection.outlook.com [40.107.255.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF6FAAF; Thu, 6 Jul 2023 02:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KQg2l9U3FZwPKer7Tr+6BMCuTknxh2PaVDmRl8/b9Q+CsGtfwF77PvlNRXwEmxlcyjVeveog9TWikvpunioNL+zXR+/l3VCTRqDkyTu+vzpigX/K17SQ86vC/hPvoa8zgW1IXr5zMVJKl08hiA8NdsGAsyHKpgqu7Io+WcrGuGyzgtOOrgtTNpAwQV+Mujd/wJZanOZ1eK41+JSRGQEC2LdarR6egO7aZ9ki9cN79dgo+iuh769Kg5bHF5u5aCqLOnKeg+z8pARwSZWmwXki+7+HP57/cTviqNKC7Lp807Bv48V1aOsEyLEIeDVOu4dkJyM0c49UmXlF9I3rD84J7g== 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=TC40/Mk4pipYtQMPyX5G7aM5k75xPSo9LeZORXXwFLM=; b=iVZwERdTueaVUWkcP/g3KSptDC8Nl76uoVohYGMYG4e3XZXekd3GKCyX9urPrW2NFQuhiKhOYOW2er+gV7aRY7Xhwrf8Q4xnk9vK9V4f8m2uR90sauZgqxZrx7K9GaitTSK1oVbQCyrkTbUB1gH6vJfXg4i09VyCBBEPgeTV/r7HP4P5XWd/Q9ZBeSbbhL6/o8JAMkN/btjPbWJFv8WPM+UASn3/tH7s4tN5kXcCmnCzy4OYop0QE+NySQR+gnhy+wELHh337llEHpTe5EayjGh24Bel1B6J3P6qhIAK90cIJVaya1asys9O/veIILJ963/tVl14ZV0yIO3RbaOLjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TC40/Mk4pipYtQMPyX5G7aM5k75xPSo9LeZORXXwFLM=; b=YPpV2D6Kzr1+ckGZxDnqD1v8CRhzKqmxD5VhufI0tByx6qBGjR/bghcaCHdi/QAgsOOW0K0QIJ7i5q82ef2SwiKRYm9X8J61LGdHHDN1cJgJ4AUtGkiqcBh+sm2B175NribjWTzNlFwIxneNETyd+uw5+hjVr1INj/5Enb1+w8s35JAXyKFm7W2vZK1ENa/YajSb/JHqiFmOy85DDEVq9uvKDPg+nvz3kcUoHcNxQwHNhsV4rbc0OxKhaDly3JVVpRM9EfmAWeRFp1uzb1tEPnf95AmK/IJXURj9MO1Ia9PXcOY/Qd66XEjCHAITPunLsY91P5knapZEL3EC3ttsKA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TY0PR06MB5706.apcprd06.prod.outlook.com (2603:1096:400:272::6) by SEZPR06MB6644.apcprd06.prod.outlook.com (2603:1096:101:181::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Thu, 6 Jul 2023 09:16:22 +0000 Received: from TY0PR06MB5706.apcprd06.prod.outlook.com ([fe80::d6ff:1295:38d7:a019]) by TY0PR06MB5706.apcprd06.prod.outlook.com ([fe80::d6ff:1295:38d7:a019%7]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023 09:16:22 +0000 From: Zehao Zhang To: roger.pau@citrix.com, axboe@kernel.dk Cc: xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Zehao Zhang Subject: [PATCH] xen/blkback: Convert to use time_after_eq macro Date: Thu, 6 Jul 2023 17:16:13 +0800 Message-Id: <20230706091613.40136-1-zhangzehao@vivo.com> X-Mailer: git-send-email 2.35.3 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYCP286CA0015.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:26c::19) To TY0PR06MB5706.apcprd06.prod.outlook.com (2603:1096:400:272::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY0PR06MB5706:EE_|SEZPR06MB6644:EE_ X-MS-Office365-Filtering-Correlation-Id: 0cfb6c15-44c5-496d-0214-08db7e01aa79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qob8ffNRD+wzU20BEmolrHKDTaimOfoJRM/Ktyh8gfiiOjn545q71M632RsMINJIi1GRuRud+zbKeT21h2LyV8p21bVRVcy6u+0DYx8fT4DBW1U4XOPYmh+uUKnCvMlwiHCfn1kvP38obepKYq3Xvse/qIyhjl+ODFmd9QkcxMjPpzzXClcbdBNnxPbhCEGQe4SxeIa7r9LlqqGBc/JFi5WOYsAgVjKbQaTv2QDyt1XO3ovkRvpcB3hk1y2ZG4lF44FsUrLIZrDvu4AK7ldNq1nOotheToVwX/aGqZHGioOIvVUlJtyTRRSOUaKj8ezNkAG3p3MGvGlLxeoVf1mPoM1O8jb0gBN1HozmAtHYCGqKENs7UPc2SZz4TNHxESoAxZySwOY1K36hqup31gqt1VtCfxQrf2nFecpLMIHFH6b8kgIviBRj6McTDNMElqc0NXbtwd/1Z5gASkIGH0uLTxAuiX7mjN7j9hPZ/aQlTPEFVMGPNadBZjnSclPqluJrlXUW/AxkTc1T+l3opjNQ7+IsSD+Usorw8gK7zEIBT9isJK2eBI37CWv0nK+hax8aoU+wWzzq4mNsEQNPEBY8Np2NReCBEL3GjTb9hf1t3tcJrmAMmj3jpd83HYsrvt0g X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY0PR06MB5706.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(366004)(346002)(136003)(451199021)(2906002)(5660300002)(2616005)(86362001)(66556008)(66946007)(8676002)(8936002)(6506007)(6486002)(6666004)(26005)(1076003)(478600001)(52116002)(107886003)(186003)(6512007)(38100700002)(38350700002)(83380400001)(66476007)(4326008)(316002)(36756003)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cxLkbjFMD31cFBSS80uSjWUy1fz8HLX+CTquCDBX4zzdb9wHOwUInrMXAzBy?= =?us-ascii?Q?Vp0lRKEZE9MYYDLsjNPoQCQkBGI8jwx6G7ZojQeFMGjs5QN1AvIPEezZAPrn?= =?us-ascii?Q?GEr15q6r/zz8qGJleOBeABX9vfRWh0N7oTl+IKOvx40Ei2axN2qkQHzJ6vte?= =?us-ascii?Q?zEWzwcWkMMV6uiDFTm4IdwAsBbcSb06iToI53B9tF82wk56r0tD3GddFRcWV?= =?us-ascii?Q?oHhZzYhJeTZnj6wYC+4AS1VCdzTI9RgIz46BscmgIUNp/XqObVOw9BSQgc4A?= =?us-ascii?Q?TxnLmqO1T8HwuC5Z8yOo5EPTonI5Vws+A9ecrE/4gmw+rhqJIOWY+ns+IrY5?= =?us-ascii?Q?F65hRCD1e+oT3xflkX7m8ypvTzTIW+SzvbxGMmKx9OD3wPqWKQYMeZ925MZZ?= =?us-ascii?Q?aBYNkW0BDL7jjVsT8Fvsm+PWnuUadEfzCOGP1qzB4np/QmjQO+UVZ2comdXx?= =?us-ascii?Q?oJ3rblqGv9XvbHx9d+DM4TuIHrIh9HjcE/q60HYrPTEbwoLxJfhnXxs/kaCc?= =?us-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xZVGtL5ekOMPU70hIabt8+Jn7bLZ?= =?us-ascii?Q?gJp2oWSk1hh0ltPpe5w3DYeqsWJ+ZhNsScbgx5rHhCrs8gCbq/92L/wnwvaQ?= =?us-ascii?Q?mdqi3R+0G3QgAuIs32ngLViv8abOjVhnJQuqIb9E4jJ7TcaOqZUfM3xWrTE0?= =?us-ascii?Q?Og9RO5567X8/Geif6jGSz95O/83EKkuERxFS4MYt?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cfb6c15-44c5-496d-0214-08db7e01aa79 X-MS-Exchange-CrossTenant-AuthSource: TY0PR06MB5706.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 09:16:22.7995 (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: 8VOZVjM2kgNNbV09fogH6VvaM81sWFIbx7bxCXQT+r3yDYZMBdO6tBF4evhKmWHHdb8PYXd4I3v9yzhSXyhyEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6644 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Use time_after_eq macro instead of opening it for readability. Signed-off-by: Zehao Zhang --- drivers/block/xen-blkback/blkback.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index c362f4ad80ab..77b1b1785eb3 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -134,8 +135,8 @@ module_param(log_stats, int, 0644); static inline bool persistent_gnt_timeout(struct persistent_gnt *persistent_gnt) { - return pgrant_timeout && (jiffies - persistent_gnt->last_used >= - HZ * pgrant_timeout); + return pgrant_timeout && (time_after_eq(jiffies, + persistent_gnt->last_used + HZ * pgrant_timeout)); } #define vaddr(page) ((unsigned long)pfn_to_kaddr(page_to_pfn(page))) -- 2.35.3