From patchwork Thu Aug 29 02:12:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shen Lichuan X-Patchwork-Id: 13782399 X-Patchwork-Delegate: kuba@kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2045.outbound.protection.outlook.com [40.107.117.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6F7C2AF1E; Thu, 29 Aug 2024 02:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724897647; cv=fail; b=hEbE0T++09ci8vtH0sS9DfCvw9I5mdPMd+GaAE+ycRkwwlIX1aajZRHy0y+E9F2RjfL3UufcuUEYlX1gfwFjzaoWu7Tm0VgTb1wR1cL8nDNIrRKSA+H1RWh3SZiruRvRE8G2TZIkdii8xs5VnFcDUmra4CS0OmU6gfDVr2PSsMU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724897647; c=relaxed/simple; bh=8ah65v29eAJ5xJquQ9zk5lXtgqHXrl80f86vpQIosvY=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=H786ddAqOBuCrBigNv8IZuHIthYv/w3JK4TxNioCYp7JYrSeEJvEwRE1O23sf1h8ozF1uz8Vt+nQivPHQ/p3zVCkl60JOn5XBz6pBQjx8pwpq3Pyqk/rQuRutw8y+L09GdoZjRojSyA5UH8VwA1ZFvqbXvo8AYLJQpUEVE32/Jo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=LMYErmA1; arc=fail smtp.client-ip=40.107.117.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="LMYErmA1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gh7ayursjmDeilBFhFKQt4HpiDmXRvcrx8w/m3ZGJVVqey5TqEnhCQAxJ8zLv9I/zWExPoqCsPaVejT9/CF1SLCM02e1nQ10xeFU0tu8XYzL/TC+7JzjszoBYBvMGm5hScVc+yfVYjGkukmivOu+N+rYwlUiC4X530ds39vniNxrclEqMnkq1Q+w97YfBbERRnUKYissd8RJNf7AP+FiPovebCw/PRHltLofnbvjCsdd+j5g4kFI9vscEucjUNc5pkcERkx/inZVuUJ2piKUZBckw5yAnyhJNbnkKrTOKfAJ9/OUuAZLAtg1dWnVExNlKSZZL3RWtYf3aVjaxrtVBg== 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=HLsDNiTd9FkKpEJWuR/jcUcj9EwfOIcC6FNmBVpteUs=; b=WNTAo+BRJ80ljUtyqwfVFJ8IkZMZm1iYX0CSQ7+IzGs4HWcE9Ey8zsI+lI6cErz1nOOxUfk1Q6OOX7UA9lxRKGCbuyvcRN86jjYqqp7yW8KdM9RpB3K5B5g3ylwcMF1fAYdPR4wASeZldlcKmIQO2FNrrTNDseYcgucveoPRzZekF4QVy5eDTwVeugajz0ozz5ak7dmQTEN6NznsCg78bVdptMtd15baCW/8QY1GgxIDFqL1bUissgPfOPs0n8HFNP22ejknbD9qWocktwSDiyAAQ3GR2Galj1yMSdKfnefPxSRho8NbpioZlCD1UhW5vB4FuM5sMcyud7kZopiITQ== 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=HLsDNiTd9FkKpEJWuR/jcUcj9EwfOIcC6FNmBVpteUs=; b=LMYErmA1Lji2rCqZW8PDJU4NgbH+r6Ti3M+D5YUXYpglX2sSeSLEWKfNEQH/jKEhvYcYoN3KBru8EG1XBFvjgGBFgjgW0yRZxwKLx0Edr3148xP3QrZFiKb6oyhYrjdFisY0Fu9PQH4okLlxmDdk0fsqxkHiFHzsfsLAbelDpbrZRMZDbCv2Dah3fU9cBxzU64vVbQAT0sE74ryhqN/CVFgNVzgPq+YhbWJqRguDqDLtfmGyXYS8FEqZvfyxTK2ZPYMD4DGOk5h09RN5YExXRydaQampx5NOkvBoo1BxxSiAaAmZJDzcvxouROlSgkBcaW2XTTobiH8uTioUfXfx6Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5899.apcprd06.prod.outlook.com (2603:1096:101:e3::16) by SEYPR06MB6880.apcprd06.prod.outlook.com (2603:1096:101:1a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 02:14:00 +0000 Received: from SEZPR06MB5899.apcprd06.prod.outlook.com ([fe80::8bfc:f1ee:8923:77ce]) by SEZPR06MB5899.apcprd06.prod.outlook.com ([fe80::8bfc:f1ee:8923:77ce%3]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024 02:13:59 +0000 From: Shen Lichuan To: ecree.xilinx@gmail.com, habetsm.xilinx@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-net-drivers@amd.com, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, Shen Lichuan Subject: [PATCH v2] sfc: Convert to use ERR_CAST() Date: Thu, 29 Aug 2024 10:12:53 +0800 Message-Id: <20240829021253.3066-1-shenlichuan@vivo.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: TYCP286CA0086.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::12) To SEZPR06MB5899.apcprd06.prod.outlook.com (2603:1096:101:e3::16) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5899:EE_|SEYPR06MB6880:EE_ X-MS-Office365-Filtering-Correlation-Id: 13b6132b-ee2a-4b4a-f6cb-08dcc7d03e71 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: JY5Nam7ip5yx5b3b52ftwq6VDEty48N5ZWNr5mTSOPxQxTuGnkyvVhga65UGCedBpy/e8iPsLs3SlFSfZxspNqIS1SvAEBemA4i3xfxKzKoncGILNA+U8kawUPSXWsnmN4tyGZdMLJiBuHaf7LbWdKvDN8zhgeI/3YfY2r6CO01fYV2GVDyUQTAJQbnWWhOaL5yz7e5hfrxrGAiEdo8pAJMGZwUTKaumnKJirO2tMKEN9/V1JYf+DEwy+yyvP3hROf5brdLy8HfOIUNfEuLkjFATkW6GBOBLLbjiK+zs3IF6VL9pwTe3Qmz3mNioMdOFYK+H7ufkr3o0bEMmPK89Ffc0QRWiAoODHAo9Jpu8zlhlVzCtIamJybkepRjSanbxI6ExyXNxcOpjFZhVAna7mYYYHiM5Hv385TnFA/EgA+wk8QJjoEcKB0YckG3KBB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od.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r0BcX6qDOovYAZTZIk0GlRlbUV8YEAL0GR23v4k0JTnioewft5uAL1fnMIZohP0BdgOj96COIrMKEG82kcBLHiEuwQIoLeO7Yb6Ye6O3X1V7CczAerFdWuEFNhHRJgFTj6fEGf5IUgmTxdPqDzvHvJkEleFQNsmjClpLa2vqtUWgRLtd6GseIGWCrEYcu7/aA6b4KemzMfli+wHCSljYpZcbQhli0fARtiqTwfZ6vE8tu5xry9Kt3ICJsj2281wlxxuS1fENt+IP1kI7bCU2m1eIpqWWOkNEQb1AtZf7IpaZu2JnJEC+7/PVXPajZdeI7R+d0XRokQ4dp09fmLHKkmQ1P7wLV2mpnxk+fms3+RtwnddHm9ErIEQI0eMCZyXOZbEk1Bs4mQf3BAjtQ8rqhzZyvpSfcao1dmHNk9upx56OlCWsTIpWGcKIKbTf/eRc6G+zVkb+KflHQWZr6oof/sJ+by5zQFOIslGcDXQJpQeLB82J0FA/wgTkRSJPIhsDgO5mrIi9QCNDTqBmxUPmd10yHTHlFFuwLPCOTzdn8/kJ2XiqB0Y4Of9POeFcaxHacJWvkWv1R0qviwCdjGzlhvhBo4cZbdsvLfZdg7w0WoGEoxnYNeeOpgxlDcXwhV97lKalXcUvjuSOf5IOOiTwllBqXma75EMnETRrDz0psd0ODXhqx9ZMCisGnqt7WBAXkMEYjRveI/fopOuKiCsr2Pb6PGZ8j088PUjCyNEoBlHCgd7qDhiYYhQo8afNNMMAWANmI7YJwfrWlQlxUXjrBZ02W/Z2JUUMltqayvAMKxJLWRGbd75jpJ7i5cFOfDYq445f8Jr15VQkmtv+9Ydu+VI3RUSIe2unGzcghPjFem+8WLc+DVVV2Br/l0pWlsgI1MHtRaWethPktkqRXYea7uROwr5PWaz8FaxvU7yPhH5OMKdelzLoPIQsyT/bqmG6Z2ou4QWj/mRzj0/oLwNQ07LaOb4vj4Y1rJc7zMYDsNO5ovd3bnHmFPfWkvw/H4Y1tJlvJUxbOEkvP6byCyNk5s5t6s5n6KdZ8TcNmVhA7lSyKUskMWD9Pyj/dVmRTEZC7VqQkkWNPD/Ydcsrdi8zOTO0Vl6C7doFf6dmHUesJMeLOiwROx4GWxWkpwFiyAVSBrWdRgVN5qATukv+KrLK+IyEgpG8fefSxtkzOhZk1rX127Tmf7FMo0LBwqsNkIqGQBoloGqAP51vyw43rB7otuM2GDC+7bRkU9nliDwWjNEcjvB4Efg+t/RdPAlL2bE17caUQ5QPLwF3yoZzROOzoERJx74yeb161R16+JUCdHmPdFzJkyN940sHicdz2iMdZUcpGUZj3uo34COzE11zVEfm2CuK4ZLK9F5hTcfiC0mIWGUvwH1xQxn2h+FRgVGceNiyVMIs0J00W+QpWrE++HvlsYV4hwRdkSduaiM8BaiyDoCDrDlU4OJrJrPOUQ8kMEgPpWXUKOmiyaHW/sEvAW2YXBI1fXzn9jB5oxtpe7yu+9QMwcEyqBql07ObKVe5VGnig2gZZ0LJwG2upHA4+7K/fMsdvhkCccZ6TcjSepu/5KGiD+tzSLKWtV31DVGT X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13b6132b-ee2a-4b4a-f6cb-08dcc7d03e71 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5899.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 02:13:59.7225 (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: 9/k1fa1+71WtWhz/XXiThBHofeVgQuzuUMecgl+QGiMyspMd4BxXkoLegiSIJnhDVgKVctgmRMnbNG5khTA6tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6880 X-Patchwork-Delegate: kuba@kernel.org As opposed to open-code, using the ERR_CAST macro clearly indicates that this is a pointer to an error value and a type conversion was performed. Signed-off-by: Shen Lichuan Reviewed-by: Jacob Keller Reviewed-by: Martin Habets Reviewed-by: Edward Cree --- v1 -> v2: Removed the superfluous comment. drivers/net/ethernet/sfc/tc_counters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/sfc/tc_counters.c b/drivers/net/ethernet/sfc/tc_counters.c index c44088424323..a421b0123506 100644 --- a/drivers/net/ethernet/sfc/tc_counters.c +++ b/drivers/net/ethernet/sfc/tc_counters.c @@ -249,7 +249,7 @@ struct efx_tc_counter_index *efx_tc_flower_get_counter_index( &ctr->linkage, efx_tc_counter_id_ht_params); kfree(ctr); - return (void *)cnt; /* it's an ERR_PTR */ + return ERR_CAST(cnt); } ctr->cnt = cnt; refcount_set(&ctr->ref, 1);