From patchwork Wed Aug 21 09:21:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yufan X-Patchwork-Id: 13772049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 B1A31C5321E for ; Wed, 21 Aug 2024 20:51:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 612D210E677; Wed, 21 Aug 2024 20:51:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="q8YE2e1P"; dkim-atps=neutral Received: from HK2PR02CU002.outbound.protection.outlook.com (mail-eastasiaazon11010014.outbound.protection.outlook.com [52.101.128.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6EAB10E075 for ; Wed, 21 Aug 2024 09:22:06 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Uyu/MWnHWRDjDMFc8J6n6RG07WHNG0HJTgK69TB3+hJIyIjvM3vkFzUuISbf7woKB2oX9j6TNIll88cpoT76vFQzdE6O1vgHESVgzAkCicXm6nizUFr95cdQSeu3n7cIAxzW1l3lAEhKoXVCnNmlUedrAVoHvQHlgOmKDhmrVfPEU42i2uDo7ZVZAa5phcyMxFPJT/dIP4ca12BSCOswLvWko1v4GN6HEst27bTQADZWiDhGcm5Qh4ZgeHMSPtRd5BJvfVIiSNaQM/Ml++609xpd4jg1kbhEBsFk9PZocfThvVRWBZ01MBi7hDBjUb/Watt6qT1lsrpNFeQ+bkoTfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=0g4669BmyGqyqgQa9ScTbOpLKeqiXpRs3AqWa3oVtIk=; b=iyJtvvaFMAQB0j6xSeF8rcm094BZRQq7WWogWKauYAoj5GWp5ADOC+muW2Ynxx4Fp1PH7Rt/f0r6ue42dZAOlzaj+M2CIZbPX74WAo7nceJ0hjgnKNZ+rO5b5yJLCiacTdSO7lduM5SHdaXHCjOk1rfPxNTvmSvkeT86T7Cxpg5I/rEcwIAnzaS3omb4HKOw44Ye457HRBsyoC3YaQarhWwKyfc0rIJsOS4h8h3O/70B3vQjWyJVWsTRqtXWpplqd+/s6maHhppzo7VPKPqPIQqGQAQHAnaljEa01R9zC/f9kKp+/+AnnYulEZU9/jEjH5SnrAmlvJEkOOOn62yDbw== 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=0g4669BmyGqyqgQa9ScTbOpLKeqiXpRs3AqWa3oVtIk=; b=q8YE2e1PtSlM1BrJDHCe0sRWNjNx3KPjwL2ccVxzyVAd5tQBgV75CDjkRVNwvTHRVrl+hOrTaGAr0jqGt9TMUgCUshwopPVuHcD9xK3ZrLumKyWFvTQ9h8eeLYpnP1lpvi5hX/j36NHOAWjKZ/HN4HuyQhbgGwoPRlZ0h1nNx64i0eLBzwY1/R2eIjZEuNGsnDaycwX41kM7+zZQxdZxo376FAlkv7bbjI49v3VAfGKvbTiM8KfNvlRzhkTWbVQec0rCs50hQzwwTJ3m1ZHDvWMQyms8lKRy2Jp4IZA6nPXnAh3jgFdbkxkdLY32/RDZ6+YSuz0hSRbT+6ymJTAXtA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com (2603:1096:820:bf::14) by JH0PR06MB6414.apcprd06.prod.outlook.com (2603:1096:990:10::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.22; Wed, 21 Aug 2024 09:22:01 +0000 Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com ([fe80::2129:59e5:6c67:311f]) by KL1PR0601MB5487.apcprd06.prod.outlook.com ([fe80::2129:59e5:6c67:311f%7]) with mapi id 15.20.7875.019; Wed, 21 Aug 2024 09:22:01 +0000 From: Chen Yufan To: Frank Binns , Matt Coster , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Chen Yufan Subject: [PATCH v1] ImgTec powerVR DRM driver: Convert to use time_before macro Date: Wed, 21 Aug 2024 17:21:21 +0800 Message-Id: <20240821092121.16447-1-chenyufan@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SL2P216CA0132.KORP216.PROD.OUTLOOK.COM (2603:1096:101:1::11) To KL1PR0601MB5487.apcprd06.prod.outlook.com (2603:1096:820:bf::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB5487:EE_|JH0PR06MB6414:EE_ X-MS-Office365-Filtering-Correlation-Id: 0adb52e8-c066-4322-4f9f-08dcc1c2b6a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: YKcdsYyRjiRYVjemlvUxyH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ctoyMGpC2dKZYP50VG6gqUh8uPULMLOaJhMGGol9kSMdOchJSfsByhTmcmMn4nkXBSNjes9Eeh1FJbHx/Ay9O4XzmszIQc3HtEhI+vi65vCY0Ty1xX2GFe+lXsFNPjefmD+JDt0OPNHpnRWByIrEjejhWrq3KP8bxiixZXiVvLYL00ReuzW5iow6NNd8iJbN3cN9StN1FFMJG8oRo+/9/PCHZvJGY/9QwtMg3WVqO1HnATw/n7bgoiKSaOo//cItXZQOEqpqGuXs83oY9glQNxrkLLoJmCaYxHWD4oerxO3ukR6YHrbHqoD7HxaSc0ge69Zdssc3cq9QsA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB5487.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7Zumcvm6hzvci91NN0Hp8jTF37RhwCjOyKTSi8l4wRNp/Z9PnLAxaeNSulD+vIMC1cFljctHgKFc2esjTqqHBgPouoDHAwAcley1MW+W3H2mDe8GVck5Ww8oFwNFPVl875LIC2ksgy01rzaVSVjopANW59vy5cxGPn4c0q/26Eot7c7q85gjmHEH0ue5V0ex4a3QyqrlGn8nsYm6EzYHUoxlU4uYEvvvCSiqu9Fz9ZFOI4Kcq0qOELF8YTUEjISAPgt86qnymnS9fjCti5AIkQ8ZN3D1oBMlKwgIf5Qx340xz/JcgXAA4owLiB9lY2IwAYdVq32XPAHS3l+t4PM7g0bLP5Ft8IVO0Mv1Pr9li8l3O3VrH2fZC5TTzrbdR3vwVOmQlKkISu2AQ9M4Ot6Qt3zjkkvKASOmB0NzbwdszC8eQgfd9GMdu2dWOppE0GGIRNXMnnPgUFzDDlp/Cfild2+2ecJFeQT/+N9d6I8ID48hDIlerVW6jCtKZ/TnNxIdsY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5wofk X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0adb52e8-c066-4322-4f9f-08dcc1c2b6a1 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5487.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 09:22:01.4251 (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: CCXaSgRjadqy6t0kGEJzvEabD7+0XS4pL0w15hRkGwdvt3DXmzqPrI4TomMzWKJkEIFA7ys7Y+Yy+UhsNDFtMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB6414 X-Mailman-Approved-At: Wed, 21 Aug 2024 20:51:19 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use time_before instead of direct subtraction for readability. Signed-off-by: Chen Yufan --- drivers/gpu/drm/imagination/pvr_ccb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imagination/pvr_ccb.c b/drivers/gpu/drm/imagination/pvr_ccb.c index 4deeac7ed..b7d5f9ca3 100644 --- a/drivers/gpu/drm/imagination/pvr_ccb.c +++ b/drivers/gpu/drm/imagination/pvr_ccb.c @@ -321,7 +321,7 @@ static int pvr_kccb_reserve_slot_sync(struct pvr_device *pvr_dev) bool reserved = false; u32 retries = 0; - while ((jiffies - start_timestamp) < (u32)RESERVE_SLOT_TIMEOUT || + while (time_before(jiffies, start_timestamp + (u32)RESERVE_SLOT_TIMEOUT) || retries < RESERVE_SLOT_MIN_RETRIES) { reserved = pvr_kccb_try_reserve_slot(pvr_dev); if (reserved)