From patchwork Wed Aug 28 10:00:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shen Lichuan X-Patchwork-Id: 13781035 X-Patchwork-Delegate: kuba@kernel.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2064.outbound.protection.outlook.com [40.107.215.64]) (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 8E595167DB8; Wed, 28 Aug 2024 10:01:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724839270; cv=fail; b=TJOdW68SCFf2HGaoDFsgx56IMFE9BdNB4qDgYMXlaOMz+rU5hLwO4AYOMRyLHkCwaG4e4vEOWbkIv848qFLcwx5uiSooQ3O7Gptredu26MBXlHXRHakCQ+xjLFaOQ39jat86VbOS4WkdVrLu9kTbX6dCGKA6GgrYh4Ja16Fo6+s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724839270; c=relaxed/simple; bh=HHUCgXhR3J6Op8k6eCFzuzJOj1cLRU5TRWSNL+s7jSI=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=hRho/McQjrn+S8p0b6bB6QmPmY8n/dAFBpwWKQe4aM49sH/Mh591biejD40qLbEQff/X0hxSpkAXiDAErsqVltr/X2oDYt1AbWVsTzbY92BIkmPbEqS3Z9LInjuPWDOeGk9hEiEWTatKXnWdVoZLqNM6ctAn+0vmgB82x1go9fQ= 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=eng/4qe8; arc=fail smtp.client-ip=40.107.215.64 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="eng/4qe8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vuyhe+h0Nhnxk+mP5W3gntBNyAFvZDj1gCKhcX75sjZofDuuKwLjfV2kG+cuYFwTpEddzkw/D2Hoz7AbtRr5AmkRa0QWVh/x0/8PY5/u18i7c78s4GuYiiDoUT0p4mPMcmC4ahq3HKFWvmNGaPC3YcgfoGdtYOC3a/pKWwQtVYFuL2isxpkt09pixLOcgBhQ5WLutcXSfQPi/H4cfFfLwazc3fmD0lO8qmv5LOEcaiy4NndV6ZxgAihwYb9GFt4rgmBLbVeSCCvKHSukO1cADaSAUH4OoQFlbxJoSKlkfJg4Kem7SlfJbtfMrUJzcsIxba38y3F7nIMBUkcuVNC38g== 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=aW3SJc+Wmz9FB6cgMxmBl4LzFElVPkoKwQTGwp8zlA4=; b=JDrWIEuex6h5cr9Htgz758vKhnNG9HoLSlNqGy2Z5Cm8dKOcVwss5lDHUTRj1HbwiVxhYnPIL3K/jS+RjbeWOhnFPIUrQAIr7TwEIRWu9OuZddQDC3xXS42r3EfijNMGnNrraUQooCQZM7sWu98hLqKDb9OBmSvVfbV0wnXTeTbvtNZdstdznMrwJqd6pN1VxsZfJRQnyi2b1nyUaryIVPpwKboYHIXmYALzsuGXOcPjb9YfO5FGs27i0H38esiPPrDc90wQ2iwhxgBAKCo8qQiVRwpARl7xYirq/9uyiMP+O2mLbMsJPUFS0BcWboUUM0ePhlVpPq42Jx+hA2lrTQ== 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=aW3SJc+Wmz9FB6cgMxmBl4LzFElVPkoKwQTGwp8zlA4=; b=eng/4qe8nXu1rvnKBkORbrWgrnVHLlVmxJnMSVmeMN0OXtCz16HYiL01w7nhw8O5hVP/d0wgLE3YXNUQL+TRtKuY4X8bGFnV7BFnpjqLWuJZnONTTyi1a/RGJBKAUZiZMPDzzIYjq+hvA/1DNMk9ncOwZYTU36+jbUqlLg0+rEkaBahdLehPHjsldvKzJzUkw+nsl5hSOgH0IHx5JJZrvgTowhswwt++sC0cRKlPQSft5D/cVi+V1NMIA/MbCh28XFffNDaQA8Dlo1plBuvee0ppU65TlKgegdzvkdunmteRqLuSF/dABhgdEvwFZ0PZf1v06cVNT0YvsMW+9JwLsQ== 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 SI2PR06MB5067.apcprd06.prod.outlook.com (2603:1096:4:1a7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Wed, 28 Aug 2024 10:00:59 +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; Wed, 28 Aug 2024 10:00: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 v1] sfc: Convert to use ERR_CAST() Date: Wed, 28 Aug 2024 18:00:44 +0800 Message-Id: <20240828100044.53870-1-shenlichuan@vivo.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: TY2PR02CA0004.apcprd02.prod.outlook.com (2603:1096:404:56::16) 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_|SI2PR06MB5067:EE_ X-MS-Office365-Filtering-Correlation-Id: dc83d218-5823-4e35-6801-08dcc748510e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: 1VYF0nKieFJdS6TKxotJoCM7Q+0t5cCcH/4YP4glV2EPuasykEMdVUSimrUzdx35pMHiczZAFZxgpl2hcri74gsBkIv6cuoEdaWBsw3TU9KreavZn4pJyZni5C3d16GWnp1lzljYtXYe0PgyqQPoqcUlYei1isYz2V/KGgTm07y4sU+3g/nbaEc27a1pfVS3tFJzJ4MlJ6oepV3lIgzRhd2WbF3D6so0677j0TzeKQ0EyGv7XJhzpqZeo7N7Q8Z2qdBJjFSTd8uzbHW7SJei0rje68cI9JuMHjwle0JXSjtlH2qz3bYsFF+54IPg+Wl+snNvdHruOyeMkdsilgNRf5jYqFl+Uo5nB8XlnfrTKduivrqPlx9ba1ub0Zpb1rWlrrBN3qCQGkZTtdvQJx91Thi5lMw4xj8+tPE4W291VHdCJ9lqvRQYoXpAQkvGLqR7oJjfh1s6R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;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4F+sZiAKACS5eQjmU2qNK/0yDY+V2Oy+PHLrgTekW2omhYDS4QhEYMvPpmnYw/cvHqEikzsnGHHTQHLXZn7e0VyeBYiKhvEDy5SVtOGDKD33vv9v/oNC5VFxEJkVmj4XCwXAmBBFsnRDubvEh7cecgWLtA5mKCQmAY000ceKEODtAvu7ChvenbWqbkX7TQSvaNbxZGpnYuo9HzJ615VUOAidxgEcaKP+AHDzysjMeXjx6ZgyA97YCXQ9Bo1FxAfXBoqClGSW/aRajjNgoaFL1cWtIKtSEHd/BssBPG2lNlOiznt4u6ta9ChaSaA6ENbCQLayzcLQDdSgrEJHXC8xOdCfSCzXrolWH9+db4Sktu4aJiI+RDU/5QyVt5+luP+/t9xB496DZQz5hT/8XAJgvLZP4SovmXimlr1B14qOQxO8MKkbLYcBmlJq7rok7j971+I8M65hel5YvNULWOupUaXUSuhOEMI/SFV/JQr7S1koSax7d4Uo/sbz6K459quFOh1P1JEDBVCgyh/q+gEeYyVnFYz4nW3E30v7skdqxUVcNGiER0DVTAymxduRvU+D2cFB3E8IspDslSGg8vEhyUtOYMDbcOp/7fV1EU5HZOrKmmFu41naIwzl3weU2uNWEW5Pqa1gfOg8a0vb3dHmlLgXSzJodfV8GH/7kpQJV3an6sQtJ5ECHlY+VCmhlG5npZXRsUXYOYQuJdVtW9z4uNWcsztRqmWNvGOXzrKjRPgQIAd8skrBm+ZMWBJWI03QhaQqft+LUjY9WdVFH+MC3wvIE/ThaqUWyPhx4QWEcYc+6kWUBgcBKGDcXu3HA7UkMvRO7UkMhZ49QABndToWlcTzTzeWtwm3NUT47HkximGaGhYoc6K/mBoC2nJAs321Yl5OV/ueiRGTZ/oox+TMP0s5PR7Z7ydTqZx4+HGIDIX0YpFEqNexk5Bx6aS5m2KnnnE+lt/9Z4B+C1R3VTayMa3mDdzLP7kN1pZDAd1H0xwUWrEEezZ78CYKTrnIz+bzsxFbNFF577Z8XOOEOAGA2gD/e7Yv7O88iKRqhK2OJV2+ZiUSUzVCHxvVe8jwYq9KdFSKMGdf7JPv/7aZigydoyFybyqi6+0ZT/KZSwV/rXRNoYRXUF0Mh8wzckZZQqqZMxNDqV8gMqmiOyS4lxPiVh8gU6Tti5s5iHdDD4DK8UDODEGfSr+2U+W1ur7XxNcCniHRvCDYmprqEIR0ca9ldiRZcMXoEs1UEXQyz+wG1INpVfQ30NYv5Qig9E9nBUuDn6QJeILsbW3V7g0IVteK/QcHsJbmOs5kd5NJOsQyFgriqNqor9+tCkc5HKW6td4ZBsousPQSBcYGyDcy9MyFQt+ZIqR95V5tenRgc2gFjnAs+pjlKMk32pp8i6TvLwauPKUMRFK5l2DEEXN05l8YBon2r7Vg0SHk6lXXSQBnFhy/ttKj3pKFz6iiz5MV6Mi7Wm6kDCaFbVN8xW/dNl2ueOZLEdGUgshRG9RWk+/Gg2FKFHCGrWnKNEqL2OSBLcWG1UG8vrTe8fBMQr5cx5rm5M6hbOrxBkaJ04HfK7ytnedURbeLSz4gCH93BGhDsxKY X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc83d218-5823-4e35-6801-08dcc748510e X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5899.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 10:00:59.4175 (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: JJhZqwPkia5hzS2l6PpJJIUGrn/bHyKCftPmt+KX80Bm7hF/VFwMeJVQ8ZYDLyo6biRR3Y4jffhtKD9NAlJyPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB5067 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 --- 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..76d32641202b 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); /* it's an ERR_PTR */ } ctr->cnt = cnt; refcount_set(&ctr->ref, 1);