From patchwork Fri Sep 6 07:01:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13793489 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 9476DCE7AB9 for ; Fri, 6 Sep 2024 07:01:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EF6DA10E818; Fri, 6 Sep 2024 07:01:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="GneD+Ajc"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2044.outbound.protection.outlook.com [40.107.215.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB67C10E817; Fri, 6 Sep 2024 07:01:37 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EtEjBuCsL1iJMq3wRdMv+mLCQxNLP5wL1GazWQxEFcXppUD2uHHUTqqVbKCbVqWEUgYGg8rFd/8iEnXzLoK/YbCCb1MtZkFXr7I/BuNuGfToRQE7sRJvJFrqoXHWP00h57eqqAU79c6AuDaovu5O0tE/dKV+wOZVxdq69B+zxH5FJOVswhgcGGtrDdpWCQkkUyUNWQEacu/dodDFdZbBK+f2PEouvEYTiaHlGTTp+DQW+q58t4FNJPdcNMWb5BB0FWycv3KbdDXKat3vw3C0Jkw1LHzwRl0VHT8X8tCgnMGmZ9iXXSnXE4mYfXXjefuDn37NSsKi2TN0jtC0d97cjQ== 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=6dC0TEeUoyustIppKT2Tw9OUZkdPI23A1ykjPmPaqmk=; b=E4RISpC6aecKbbYWj2cRM2RrEOL7dZnb8Vi2V/fLwm0FUsEoaTNaI1nzBc8gVRfEsyPtKLazwofX2OKsQa0gWi2o77+v3/0U0MKLH1cfRy0LljcQQpNqZ/8DTP8oYJB0GwmYcxCfBigOZZSmQjkTJKSLBrXqzsz0WxJdBLTvZMMynU1eN2TdGrKpDjCn1E+9+3fAlhbEOvaTsGtwwrCdgQYPHF6h8lHAYd4DV2LQb42ZmvaRZM5EktSUH96d0ZgZZSKAGOh2so49tAVrcC3ptwonats81iDD2V3m6LudLitezcJ3hJEpejNkWmjV3M+PcbcpDGn9EJMyDD1QdLXZiQ== 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=6dC0TEeUoyustIppKT2Tw9OUZkdPI23A1ykjPmPaqmk=; b=GneD+AjcCr4sJUJ2+aEaSIZgJU4/CHq26fgOoKLMLD8ILFFoMVvhNFv5Z62D6U3MRAp8LvXbJn+5r5tmBHGMvJIT/WEouGoV0RhF9GYueefDf5ZlW9d9V25GbDF66IxiPBnt71Mg8PErpjcDEMTlNiNJtEyu+t0TBkP0NVQglJ6TasieAvfNwGLsU8gmNcPX8GAsHx5aud8vd1rkHX94/sIHbxd2n+FzOVIn3H9HmKXOdVH1DmXLS/1o9btTTZ2df3e4pR9GLNDF5+CfrP4Tk2znjFoFR1PgkqA6GAZvqvEC6OkWz55bWxPT1b9qw6CnRH4VXihLLk4/BaDmh+m69g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by TY0PR06MB5494.apcprd06.prod.outlook.com (2603:1096:400:265::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Fri, 6 Sep 2024 07:01:32 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%6]) with mapi id 15.20.7918.024; Fri, 6 Sep 2024 07:01:32 +0000 From: Yu Jiaoliang To: Lucas De Marchi , =?utf-8?q?Thomas_Hellstr?= =?utf-8?q?=C3=B6m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1] drm/xe: Use ERR_CAST to return an error-valued pointer Date: Fri, 6 Sep 2024 15:01:09 +0800 Message-Id: <20240906070109.1852860-1-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR02CA0030.apcprd02.prod.outlook.com (2603:1096:4:195::17) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|TY0PR06MB5494:EE_ X-MS-Office365-Filtering-Correlation-Id: ebac8c18-4a99-4f2d-bfdf-08dcce41bd3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|7416014|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: WS1qz1ft1A4zblpoMKMVFG/HCjNTOxdsGDVR/ikHzA2OvNhIWUvLhMRlwFl1fv3qpO1+sgrtCIA40mYbTsMDUY8h6+CBhV4tHRdJbMUKkDijtF1Nt0La0sKSWByeqjeToqTT0p4FYzzPnAU0KcM2nWWqG2ZcD8rkrJ9KsRIE7EvympSTO+cklOJh+Khc+yo3FjUyDCl9H0gAycdplJ1iRl/sIeB/+TFi49HiDzVsWSfIdoeBVNwERPzdDaRP8Nywh+ONy4hNctOocudnzDAUx1X7aEsVvKt3nQeuzfIN8snehT3692DaUplWW9s4lGFuenlPeTljVmqW/zj/lff8mKyj2e0rMFPM2QEScih6n3Y7Dp8rEd/RjqgQXM//HJIrj7NXBlDpADcBj5TBlqE6NipI9NlTPpJfE/Gem+WwJhIXIZ3loWf90CU0D6czEwRT8prmw/KA7ERGaZLinLm69o2Y4YigMgKO4lt2ipSErB/kwizmN/l9zxL0G4g8pXPukCE51jgMXescLl21ntoxdA+KmigkrLJlTMOBKVknr3DRA2Upk5bcBiRI3w/giMl0GYGUtr93emvaHfrk3V/O2S9JWPPC76wWi9drg1RzwJIQsWJxUAKnQ2Ia5SMtKuAGvuUoCsQpFv2SQ0TiUC0xlS+3IMWSRBRdy/aG9tia1Nb44YeMblwpdn/O5da08JVzzHPt5avHBGIK/qv2tCkUFCSMiP8wrEYltxM2fTU1CkkIP7uDNWML2DSlSRMFHEe2sgtU5D2oYiryDtpDGDudTfwBGidO12H8yCvyBRxBAdRmZYvrqYf1PMl7n1p7dtiMOjRUAGSKvo96Rh6191W9mgnZ+LhjY2cBYcRXzoHjJSffZMLDAjpkfmIz2E3jLFBzgXla5MdhsH/EgqrplCHNTpNTb+YfdWrm8zq99+mm7URNpM+U9Zg42wxy0eF0If6ptDZDqYOaeRtPdsmJP2IODf0rbjygt0qwn1FsOHwIOBZ0koVWt9nAJp09Bz9Ik+y0q7g6/qQe9dkWI/EfH2v+YTFS09audZpbFUvhIeTt2GbkGFT1ZdV8YtrJUaf6v53tUS6XiYzwrdsAy92OxdNB7VK9/fBSl8SMfxGYoQglZ6qYx7Xmi1dlqmGFPZ3WAw++AxDsZ0gXoe76Y5l1irl08FOx7rBDFok8neRZ7ReA86PBrB3PQ9vBHP2IKMFAawIVLUUCkbe7uHDEQCf/ZF34bplVZnb8++KTorAPlLYcK8w8/RQAVOdfp7S/vGwurBB9CT1m/bErmdQJ18fEzNlVT59JMKcK9UZioB/wZvZdhy4YFt7s764OU97ohBbcaaQxNbwhgH4996OMlwrC2bxCZ9++osojwvgLhoYmHjTSYaexWCiFEVOsHK7ovk4gPlGDtIs2SEPse1ciL8w4Y/GWAyPpN3mvA5ydgy5Hv2/qZd0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4461.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(7416014)(52116014)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u//cb1X+nK6ZUzD2HVoDNmfdjvjOUjtbSgsLrG2a7kHkUUnmKxGcMkPnGHQaWrAVqM88Pf23nhpBs5CKX7OLmp9esb3xcMD2+hvnB3guFMGxWJtojvn52HjXyitpILAxmgPTEm+AKnjHvb1+2D1LIf7w2W0tpgLYCh1C+OYGWPDJdlnbW4rHcxSUVpumSdZ4u+uevRjnSZaeJ+u0Zi177Amti76/XA1uXlsKsHNOmqOY9zbJx3/XvrmYRag+5hIECix9AbBtnnr+f7KsCQ+kbhgzWQKpNmHZDY3AzrY/go/xkn3TrG+oD1lDGuKBXXv0jhgiWpzA69SQ8To93Fz4oEt299zJj+RQPNeWfhViKM+nPjThL2c8BHnaT75Bn7GwaTQ2I0A56xzxnUjQTAe4i8kIEVd8sRCSXWtFoacupB5w1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Npq6+bQWoBxCpmVktC3y0t40tOy0mU02jazIBK8IeAEY4878O0cfvzs8lj3Eea4pGLA+EBEIFR3KtblYyTeog2AZY5OS6/wX4M0jb51yXzD X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebac8c18-4a99-4f2d-bfdf-08dcce41bd3a X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 07:01:32.4323 (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: dNlomkDxGgfD/ycaq/QxaedzX+2OaPlrBVU1QAY474o0N6a6RobwqxL9X725MjjyE7RLbH1AdSo57dJzYSHhJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5494 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" Instead of directly casting and returning an error-valued pointer, use ERR_CAST to make the error handling more explicit and improve code clarity. Signed-off-by: Yu Jiaoliang Reviewed-by: Matthew Brost --- drivers/gpu/drm/xe/xe_sa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_sa.c b/drivers/gpu/drm/xe/xe_sa.c index fe2cb2a96f78..e055bed7ae55 100644 --- a/drivers/gpu/drm/xe/xe_sa.c +++ b/drivers/gpu/drm/xe/xe_sa.c @@ -53,7 +53,7 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32 if (IS_ERR(bo)) { drm_err(&xe->drm, "failed to allocate bo for sa manager: %ld\n", PTR_ERR(bo)); - return (struct xe_sa_manager *)bo; + return ERR_CAST(bo); } sa_manager->bo = bo; sa_manager->is_iomem = bo->vmap.is_iomem;