From patchwork Thu Aug 29 12:43:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuesong Li X-Patchwork-Id: 824381 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2083.outbound.protection.outlook.com [40.107.215.83]) (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 B26DD1AED48; Thu, 29 Aug 2024 12:43:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724935436; cv=fail; b=cxK+zhfeDi9ygnGSIQDwFNnZ4hLRdUZWzcG3+sxg05+jkSLciR0u/m8mD8zv5GSGmyyReFJ4Urk6hJGJisII6HT6u1eMFmX/y4RFCHfg+PNaVpSRkuD9FKnnijUtGHT3Dm1B4g4+Bta7prMIlM8IwrusBGYfLVlSv+iR61A5oow= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724935436; c=relaxed/simple; bh=YC03SQnYj/T+za/oSSRZR7+EhzzdjSI4JhNe5YrZstk=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=CWyZvJ2S+rlXwC5yKAz2+FpAsNurnDU0Ex+3OfAOEtIKuHBFMurQgHNk1k1IlSnU77zKJIFRIq72I81VRqF8mXlqDqzrzkAyNQuhYgIJUQ9ccmlb87C2kdIVdLvJjBaiFRXfb6JGdM56iz34tfDbdhRA0KavBPwgYtpRxf/Dq6s= 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=jBHkU2FL; arc=fail smtp.client-ip=40.107.215.83 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="jBHkU2FL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hFmC1dw9HaSE3st8B7hz/Y8NnIPPfoVIEohqo8Zmnc/P9idU898xhMhou++Vh6EBP81x7Gm4cEbZXleBgf/5IA8mjb5Lik9vb++wJN7+E4ow7gdcP2rZ0HcaJBG1uPhXxelyooX0DodjAqHOhrtp9vrB2Kv6ClbSghgt+Va87DsM8jUMFvP/O5jlHf7XdxV/TYkIi3B1a2vxBCLzOIW4rQ0VAmiRggxBx2vDxDlxHveLgUJ6a9WkirZTHZhUuDNUpZG01TJhCu9ED5ou58McsjKbnJjnAqlr1McEnHJ18Y7raLChXSAjblItXtc/2p1OkXbEUFlgjzeJcFMhMRerWA== 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=yIvKF2fzg1uI2s0A3KofCkTNfX0t3SY53tI4ftOFVyY=; b=w/yRMpZoDdJy0o/+nkp7TSEdPBxshpQpyfG/yy4/N/JibHR6F9O48Wk7mMmdLuKkc+D7EDsc6k30a/qrj9mmz4+GysoQz35+XI0SB7NqmdeF0bnx63jw1H24+kOQLY5aQXV7+W0W+UlapwKCFh0hMlnVM3Wyi8ub/nN0VT2JBIQQbIAs2U0sNGxRbnp9jYEmyEGLZZtghV+oPnt6vQ4Ls3iJDYM3xh64PxHyLvhBNhmDlbkO52OjI5kU3IQPpabEpRNxatlIw1/4TAvObjyXo36jLL/lzOIqdcy0p1qnoxMFqecEdOz7HVdymhM8cphLmTbRUefU80lnrJ5FbJHmeg== 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=yIvKF2fzg1uI2s0A3KofCkTNfX0t3SY53tI4ftOFVyY=; b=jBHkU2FL9exO8pzHKpZICcJtGrddaCZ4PjTSIL6LUA+vunCF1S8gauSGOz8vUMK17zVqvk4y1Z4fmCEIBqx0H6xVAMIUFqRlGQUpWU9tvJz1Lra1Y6AW5bJbXano5MA9bTs0j0rPQVxi7ROsycyv9Hi45bMi5EYYjbzFX6LyAOC49iiDsKPhwL9cgUX2tQY2T03832Z6PwUs48YL3aLSC1AYGqrjwrde68f6vHCQDVrtvQmOBz0rIFbagwTlYVY7Md06GqsRp/asUhYbQsFkGqxEz78/QUYKaXZh2fLJKeE+ZpPN3Y0U94gwVpWwrKrp9R038k1HT24dIjAj/xHvPg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5709.apcprd06.prod.outlook.com (2603:1096:400:283::14) by TYSPR06MB6528.apcprd06.prod.outlook.com (2603:1096:400:47a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.23; Thu, 29 Aug 2024 12:43:51 +0000 Received: from TYZPR06MB5709.apcprd06.prod.outlook.com ([fe80::bc46:cc92:c2b6:cd1a]) by TYZPR06MB5709.apcprd06.prod.outlook.com ([fe80::bc46:cc92:c2b6:cd1a%4]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024 12:43:51 +0000 From: Yuesong Li To: kvalo@kernel.org, kees@kernel.org, johannes.berg@intel.com, neal@gompa.dev, a@bayrepo.ru, justinstitt@google.com, marcan@marcan.st, j@jannau.net, wsa+renesas@sang-engineering.com Cc: brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, linux-wireless@vger.kernel.org, Yuesong Li Subject: [PATCH wireless-next v2] wifi: brcmfmac: Convert to use ERR_CAST() Date: Thu, 29 Aug 2024 20:43:26 +0800 Message-Id: <20240829124326.3257874-1-liyuesong@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYBP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::17) To TYZPR06MB5709.apcprd06.prod.outlook.com (2603:1096:400:283::14) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5709:EE_|TYSPR06MB6528:EE_ X-MS-Office365-Filtering-Correlation-Id: 33e96aa1-9826-4462-80e0-08dcc8283bd3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: agRE1Yy2ETho+J1I6tZwUX2HMt0V+T5XeIuRzyhwzJyud1h2uzIBOCrr7unuppwa+OABgvyQmHJFboXsFJOKixk+aNV6kBIpXAg/yv0ed+QpRLhhfp/lh6cWGHXaUJ7QVDDwYkjH+VYNmISNho0jQh+xs+NMzp8qbHL59ZNdjBZYNXPo8zQVn4SMbHRQv3uCArKutJJMwCVtw5CFHPgPTqGZq1z237NpcbggIdsb17lfjC/DnL4ix2bfnG9Zxtlio93w9WmtLqW5vVs3q9WXYZd1kvi2GvO4mLNANnkOWPnqIVAGnyKcxQMPcE+BOiCKXoYPWAvkoioqsKVTb3MLjcO92UOp00T722tMddX58UKEHaJgXwkOD72dHrjJlIAfYSsHOGXFpmVZc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IPV:NLI; SFV:NSPM; H:TYZPR06MB5709.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(1800799024)(376014)(52116014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kn6f/pGr5gq9hujvCXrAndH4jryAuOj8ZxEUDJVuJLaCaHGmNl2vuz52P6pythZlgZE3mbfpQITmIDgzx2AUEdgW31o0Mxxh1wFRuVmwPAy0LBjbOu5ys9EFzl0dgEw9dJhw79nhwfD3AJanxrqcArlChc397C+zzIJshdiG0rkUbhMd8s2YPGRZrhm6cgSfIna91wv24Jx/V1gSpKddPhAQTDyfURNcdHeUDyI2GhKGZq7damfMpBX/vBOERpMR8WZmWqj/5t6s70SEfU82KN2LUFd3JnD6hQFG1neiPeEzNwVs93+z+yDrPaULI3CDIwg8tdFWkpRpXvBm0enSTiNb4m0xYlKRQBQX/yctn85AfIQHyE/55QxTNJMKyt/iFbL7BLKqRdyHcFuZSNYAmaoDIApHZDKMeWn/NBO4GDVyHpsp5D4PROU0Ik8POX/53PwCwg4i+5sx7NxeXbpXQwVKGCrNI4Dt4y66tI81zha0WwOSzCkgmBlnyp7s2LGTbReama85kwsXGyBx/EsaMfTb2dL70FjCqMx13Cq6y+DG7fcl4auNdMvYb6WjDVH1xHf0ry3d1idSkC3PfiUwws/BzqWkdk2ztnHqewlqq8BQhwRZ49w8PEbVHuGkOy2apvaCIkyO2hhTf4cQEz8/KZWn89nbWKgl6JTxK7m6hTDwROqKSr3TvNY8K2TPYTVJgAIdFGZ3SbaA8RIMo3yGz/4ypm2EBOhNxqiQXxw991f6ZBT+ezv5uRN1pclkUNiN6Gu/90gJZNXjwIY7uGTARrSzhYwH/w/iq5AbAVLODBqWLGffHrDLf36EPOkWwDsIzf0JNxjF9EhJgHBpoSvMVqOZnasfx4nObC7xNMeSa4mbYK5r0ScoBLRqDhZtgfOHJD4AiYIw/ZIxdVFq82pII0i6w2nnJPBGLUtpGdwy6wJfIIIQ6Xc0diZnQNAJbRP7XBfyO7Bf0a2MC3OEqzq+gtAeYSo3/Opv7/9pW6cAeyksC3EaSAg77kfqw0euaA7YXtk2XEmMrIgyMu5hkZwu5N8KBvj2RI1ijX1cumI60a0hhSinDaEtbAwWOtSW0ezLIpdhmTvrormFRt1GswUlnNwHKUXXEWYmkgMtlcRQq4JydedrNCihslH+gkDKIOSewXTkZsqshW5Oa+ImnZ9XpTOlHG13imAg4OU39IgB+MLZ2xZ7Md9pJZUmlbJAk/CDdV22Z9B3zNoBirZWkDs3hHjq9bw5tGd/D+mkrxquCUColuWamNLyj9g+lCj35+grclZn4ULQ71MgD6yeCbQ4jVOjI97Fh7DpNi6nLVmWmp9jpAOFsFW6ZC91ZRiJkSVa4H0rSgMfjHTlLZOmIpxoy89kAv9K0Vm3jEeJNluPXIt5yok8oFEmCXo/2lW8IxjcwoO/l4HnY8AjfJZgB4CHJ2sRctERpPyAWTPbn33GZDlMN1VNV6n+ghSkQq9TmpA+TmvM/hxLS18ZbVzNKBGZ+X0eGd61hOiSWZJlauohQnDARum+3u/okVJfP/JnTROm8c6XEG6OL/HwoYfEUnP7uKPugcS65XGWOzZ4JP5LhO2/comeG8qfVCjHd6ZPV3GI X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33e96aa1-9826-4462-80e0-08dcc8283bd3 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5709.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:43:50.9364 (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: 8lpe0NsifCaTFAR2/3gAoLO59ETlwPAftGXEGnoNsYl0YSZ1sFQbUymGWY7bcVqJI4ZVZqcsRYmhNzK8AYvggQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR06MB6528 Use ERR_CAST() as it is designed for casting an error pointer to another type. This macro utilizes the __force and __must_check modifiers, which instruct the compiler to verify for errors at the locations where it is employed. Signed-off-by: Yuesong Li --- v2: - Fix the subject and the PATCH name --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 815f6b3c79fc..3ea2824f8a68 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -836,7 +836,7 @@ struct wireless_dev *brcmf_apsta_add_vif(struct wiphy *wiphy, const char *name, vif = brcmf_alloc_vif(cfg, type); if (IS_ERR(vif)) - return (struct wireless_dev *)vif; + return ERR_CAST(vif); brcmf_cfg80211_arm_vif_event(cfg, vif); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c index 6e0c90f4718b..2e627f428f5f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c @@ -2164,7 +2164,7 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p, p2p_vif = brcmf_alloc_vif(p2p->cfg, NL80211_IFTYPE_P2P_DEVICE); if (IS_ERR(p2p_vif)) { bphy_err(drvr, "could not create discovery vif\n"); - return (struct wireless_dev *)p2p_vif; + return ERR_CAST(p2p_vif); } pri_ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp;