From patchwork Fri Jul 15 22:46:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12919875 X-Patchwork-Delegate: kvalo@adurom.com 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07EF7CCA47F for ; Fri, 15 Jul 2022 22:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230204AbiGOWqe (ORCPT ); Fri, 15 Jul 2022 18:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbiGOWq3 (ORCPT ); Fri, 15 Jul 2022 18:46:29 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8679DD76 for ; Fri, 15 Jul 2022 15:46:27 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCU4n-0005MP-Bh; Sat, 16 Jul 2022 00:46:25 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1oCU4l-001CJG-G1; Sat, 16 Jul 2022 00:46:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oCU4k-005R1b-HB; Sat, 16 Jul 2022 00:46:22 +0200 Date: Sat, 16 Jul 2022 00:46:19 +0200 From: Uwe =?utf-8?q?Kleine-K=C3=B6nig?= To: Florian Fainelli , Kalle Valo Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Eric Dumazet , kernel@pengutronix.de, Jakub Kicinski , Paolo Abeni , "David S. Miller" Subject: [PATCH] wlcore/wl12xx: Drop if with an always false condition Message-ID: <20220715224619.ht7bbzzrmysielm7@pengutronix.de> References: <20220715103026.82224-1-u.kleine-koenig@pengutronix.de> <0c91388e-17a5-5304-d554-effb4bc4479a@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0c91388e-17a5-5304-d554-effb4bc4479a@gmail.com> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument (in wlcore_probe()) and so wl is never NULL. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König --- On Fri, Jul 15, 2022 at 09:00:42AM -0700, Florian Fainelli wrote: > On 7/15/22 03:30, Uwe Kleine-König wrote: > > The remove callback is only called after probe completed successfully. > > In this case platform_set_drvdata() was called with a non-NULL argument > > (in wlcore_probe()) and so wl is never NULL. > > > > This is a preparation for making platform remove callbacks return void. > > > > Signed-off-by: Uwe Kleine-König > > The subject appears to have been borrowed from another file/subsystem. Damn! Fixed here. Thanks for your feedback. Best regards Uwe drivers/net/wireless/ti/wl12xx/main.c | 3 --- 1 file changed, 3 deletions(-) base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index c6da0cfb4afb..d06a2c419447 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c @@ -1924,13 +1924,10 @@ static int wl12xx_remove(struct platform_device *pdev) struct wl1271 *wl = platform_get_drvdata(pdev); struct wl12xx_priv *priv; - if (!wl) - goto out; priv = wl->priv; kfree(priv->rx_mem_addr); -out: return wlcore_remove(pdev); }