Message ID | 1646018104-61415-1-git-send-email-wangqing@vivo.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 393b48b8cdc66e1e2a504e0d934357da3047598c |
Headers | show
Return-Path: <xen-devel-bounces@lists.xenproject.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62B0FC433EF for <xen-devel@archiver.kernel.org>; Mon, 28 Feb 2022 03:15:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.280101.477924 (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1nOWVO-0000uZ-Jl; Mon, 28 Feb 2022 03:15:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 280101.477924; Mon, 28 Feb 2022 03:15:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1nOWVO-0000uS-GN; Mon, 28 Feb 2022 03:15:22 +0000 Received: by outflank-mailman (input) for mailman id 280101; Mon, 28 Feb 2022 03:15:20 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <SRS0=0PrO=TL=vivo.com=wangqing@srs-se1.protection.inumbo.net>) id 1nOWVM-0000uM-OI for xen-devel@lists.xenproject.org; Mon, 28 Feb 2022 03:15:20 +0000 Received: from APC01-HK2-obe.outbound.protection.outlook.com (mail-hk2apc01on0706.outbound.protection.outlook.com [2a01:111:f400:febc::706]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a64ff3ac-9844-11ec-8eba-a37418f5ba1a; Mon, 28 Feb 2022 04:15:17 +0100 (CET) Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by PS2PR06MB2454.apcprd06.prod.outlook.com (2603:1096:300:45::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.23; Mon, 28 Feb 2022 03:15:13 +0000 Received: from SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::49ef:baa:8c3b:cb3d]) by SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::49ef:baa:8c3b:cb3d%5]) with mapi id 15.20.5017.026; Mon, 28 Feb 2022 03:15:13 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion <xen-devel.lists.xenproject.org> List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xenproject.org> List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help> List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe> Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org> X-Inumbo-ID: a64ff3ac-9844-11ec-8eba-a37418f5ba1a ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n1fEWfHCHkAUJpDNFUgKGKSfUYPuyoiT3QrP6ueVail+mA/KRZ/XunmYzqsvAIT+Dph4Bg3gMteyIOXc6tNCnQJCqnjByWvZx237XKYxYmPvvXMNaon4nx25k5zZvpNWPJA6nlILXvnZssSjVbiImVY67a3HHRYVLMZPmrdbDjoYBR0JVFag9jXjJPf1jjvib2T+/osRn1I5W04skS2HXf7jrFCnJHkW7Olksrnoc1iEUIyZjpVySFKi2CWKj0aB4uGlTk6IGI0tFS/Qg9Uy81lap62nUqKErWSpS0l5+BSDmWez45Pd1zvtuogW8KdgXxQ5UDOiYwLlvyeCNAXyQQ== 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=v8krF1cSsCFYuWdZnXErYBDMuwe0kPjprcu+E4vYgxk=; b=T8swgeEfOCQlPLxu+xYDfSqF0DkXbdkyCk8jKWsNT8aJi7kB08PAnULHxO0nkL74SZ+WhVQ4s6YNa6ll3ogfZSmVZtyUd97HYgiR6TnpupirkYrjAWykas0LXaY+Dr4+F1V2i2dDWNiwvlt5iDayPpEOaUf366TmmFLp+af1/L48JypErtl2Uov/6Qdq/cXyI+vATU/COav7CHY7TpJAOsQuNp7LLgyVr0SWhwxiT7KAB9ZGaFeae4ebVcufje0kRh+ygPSIcWvr83OYJIOBogY8ReJXBa/NXhUxE94Uuko5XFfVyeWilW9K5KMi9/67uDDp4+5mYQIVCTrgvI8i2A== 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=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v8krF1cSsCFYuWdZnXErYBDMuwe0kPjprcu+E4vYgxk=; b=V1Zs5e1pwDes0wr0ttkRBMU8aXsPE/RunOP6TY13hzdlOWKJ/qDbDfxKTP1kQzA4oxTzM2dc1zhC1Vku6AWeHaR8sgaWT/KsbvluB5gJ8JfOtNFGKX2tZy7dE4SXb3AZinIvsvmDraI2FkNbu+bpizYNHpkU4tAlHHUVxYIwT7A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; From: Qing Wang <wangqing@vivo.com> To: Boris Ostrovsky <boris.ostrovsky@oracle.com>, Juergen Gross <jgross@suse.com>, Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Wang Qing <wangqing@vivo.com> Subject: [PATCH] xen: use time_is_before_eq_jiffies() instead of open coding it Date: Sun, 27 Feb 2022 19:15:03 -0800 Message-Id: <1646018104-61415-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain X-ClientProxiedBy: HK2PR03CA0055.apcprd03.prod.outlook.com (2603:1096:202:17::25) 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: fd0805ba-2ddb-41bd-1bae-08d9fa688916 X-MS-TrafficTypeDiagnostic: PS2PR06MB2454:EE_ X-Microsoft-Antispam-PRVS: <PS2PR06MB24548CFAAAD967E65022F11BBD019@PS2PR06MB2454.apcprd06.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GRGi/Xd/OUNXhHrQXT/dGia6UKXpRsPlLnTi51rXEqsjh/Yssv0QAJX7N/JmANQuOxMq0lFNA2b0+Nk0GPTrXIuJDNSkF43Gl2I9LasKSGkj7ajt0Vq07Spjw5hqZ4B8Wko/f7b/ovvMQvxOSoEP0ivBHmdr+4G2TBGY0sHiJC2OSL6QRG681SeQqnmu1XMKWPxKj40jOGkzWez0oMZ4VP2x2YDT4B74VduIZO8ugjTpJrykF5qBikyBcvzKwhmUBLH/Xb0HjrMdI1c+H/t74UjC50FUNBnFclmj1di8HabPtFalpjjvjIXMwGFVjxFN2BqfhZeTKP7YqRfGbjuCoe7XaEYGl9rJjtkM2QydBXdiyJU5SNHDNJ5Zx5uBBqWJ2q5laT0Z756EExfO4NkU+GUBcIpMnpV4zUdfzWVN++BxnklHrtjwi926VbgA4q97qX/0b+ZGoOKpubdbZxCj+glmSV9AewNW72e/MOn8uKU21v34LNj0vcq8igK1O/dSIK83v2MAlUDURuITW7YVReNOMCNWbZrRZzpW0tOORpy7DLV2fLi+jvMLIV3wjuSUBNOt41COaHWzDM1m5AJ/Qa953bW8IvDef58Nm1o5t0N5YcyWOiyYDPlQ1xolT/v0h0Q/XRzNecRaLGfZXwmxhVq8akySRv6nldaVNaC4y9gApVq0b8E155ysqWQrIz1FxvmbkHl1ZWs2kaGZ5s8saw== 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)(5660300002)(66556008)(66476007)(66946007)(316002)(4744005)(4326008)(2906002)(86362001)(38100700002)(38350700002)(8936002)(52116002)(6506007)(6512007)(8676002)(186003)(26005)(107886003)(2616005)(83380400001)(6666004)(110136005)(6486002)(508600001)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gtZr1btOGnkEeac1kPh1nFGZkRZXhA8zlCuSivctJ5oMEJPzCRy+ZQLi+Al5+eahW1+aUv+ok6JyoGHfQOJqsHtYAlJGHrGMePe1cY380lUjAMe0ps7kZV0Tu5j4Xf27jhh6jP1096dGd8Xa3PSgd0wKC+ilnqLU9eRwHVNEqZB8W+brrfPk69ECmiEaw7wJp4pEegcabj+AHTQ+SDaZLE6vhOLUX2S8BqqNbVgmwx5ThS63tmGNwbRza26U/Iisg+FwZl96OfjqnqXkdErkBGIU7nlHogP41sVrNAoJAU/g6spy5Jawh3MQrrU4gN3hdcIR7AsqAKMpKVovbFaWdISQ8Aj/zeVOw8zF/zQRwtdC+86j+j6rm86XNcwt3/+giEZLE/iTqNwDRE81I3+wjmmDPvpT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bfXKw64+LxKJ3zoWcX721YnTRggeI4rFvitwUzzFNZJWShO1lnFH9SWlZdbI4lHXSxZs+jeagK554Wp8D8lLX+qZnfXJJMNMpmav4MqyZ7U2KoCU25+fm+Q6kzfZjJMNZ9lHK2R2EHWu0JojH5vWHnpX11Tfp6+WkiKjJ1I= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd0805ba-2ddb-41bd-1bae-08d9fa688916 X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2022 03:15:13.6074 (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: 5Yi5/LVrwiDNSXXtQ6WY2QQ3DEiVs6VNs5x16XAbWDkO1ty4kRNz0+koxg9llp7BTdfjWfHXfT9YvG8BrMZKhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS2PR06MB2454 |
Series |
xen: use time_is_before_eq_jiffies() instead of open coding it
|
expand
|
On 2/27/22 10:15 PM, Qing Wang wrote: > From: Wang Qing <wangqing@vivo.com> > > Use the helper function time_is_{before,after}_jiffies() to improve > code readability. > > Signed-off-by: Wang Qing <wangqing@vivo.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Applied to for-linus-5.18
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index a2c4fc49..dfe26fa --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c @@ -59,6 +59,7 @@ #include <linux/slab.h> #include <linux/sysctl.h> #include <linux/moduleparam.h> +#include <linux/jiffies.h> #include <asm/page.h> #include <asm/tlb.h> @@ -794,7 +795,7 @@ static int __init balloon_wait_finish(void) if (balloon_state == BP_ECANCELED) { pr_warn_once("Initial ballooning failed, %ld pages need to be freed.\n", -credit); - if (jiffies - last_changed >= HZ * balloon_boot_timeout) + if (time_is_before_eq_jiffies(last_changed + HZ * balloon_boot_timeout)) panic("Initial ballooning failed!\n"); }