From patchwork Fri Jun 3 21:07:51 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: 1638863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=F6xYvMHF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LFFql1xWVz9sGf for ; Sat, 4 Jun 2022 07:09:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Yfl3/2gczsUBJm6pMXbprIX/7/Qd0gHaFGM+mPtwKp4=; b=F6xYvMHFXisa5f 4rHsw9qBYjkxp21RnfEyeTnu1HvlLmFJ6k/3gAIgWiBV6dpCizDV2Bv97sAJcdjNuInfkB6aGNcqa NwHLj7yIlgP0ZpPpLWXzmjhaOvrhWLETNsZ8ujUW/6sZ9iIQqTCEmEWHKfthBNt1/ybre3isbMkIZ 6Y78j++PkLKsIA2Mrxs7CuLILLlpuyCCm6CDQMPpPFg8vhSA61iulJ+I6AWUEeKbMHS8RpHdniqJR izDnSpbRxsk/+O9xn2VolE8QmgrmlkoVQTandyOWvPzvwFoGpLQ7bfiQTM7aACOG6yQnmRI6t7r8r /22Tol/FAIfpqV5DlPPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxEWx-008h4q-7V; Fri, 03 Jun 2022 21:08:27 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxEWl-008gwA-HA for linux-mtd@lists.infradead.org; Fri, 03 Jun 2022 21:08:18 +0000 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 1nxEWc-0003rJ-Pj; Fri, 03 Jun 2022 23:08:06 +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 1nxEWd-006HqH-Cb; Fri, 03 Jun 2022 23:08:06 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nxEWa-00E1HT-JU; Fri, 03 Jun 2022 23:08:04 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: kernel@pengutronix.de, linux-mtd@lists.infradead.org Subject: [PATCH 07/14] mtd: spear_smi: Drop if with an always false condition Date: Fri, 3 Jun 2022 23:07:51 +0200 Message-Id: <20220603210758.148493-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603210758.148493-1-u.kleine-koenig@pengutronix.de> References: <20220603210758.148493-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=908; i=uwe@kleine-koenig.org; h=from:subject; bh=luBv8UR7dXw90SiwPs6+n3Bdfd3lJzY6UDFPwviizNo=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBimnfbBW0o91pkJwpTgYfeyyPugde6C1BHRE9mZICK Dt66j7qJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYpp32wAKCRDB/BR4rcrsCUsMB/ 9enuY1SEOS4JLPqM0JjLw34iWzNTB0AV9MjRxWtnYImQhz3YmoWLua6VPaG0BYgLscDWFmZZNarnOu 1KaFpGu74mvQA8zmQoVs8v6ZpXFhMdEB/W5wnZVQL73icESSFtyDmllXDxyamlkAVu0kce9vqX/g9h YruAh1A8B9hzSEz1AZBvI2ZBqBQH9G3o24nnzT7QlWAjsAJYL9PfTGXrUaqlf944lnbMcgJMLEfSKE 3qgxP/DX23Hg82+0rtZZijjQpkIb1tMyMJviXl/JKyi5tLJnV9fSM4U/4zEZhcR/yRCbYiqmaUqj5K b6iWYpxH55BoZyhYNc1K32ETt7eimY X-Developer-Key: i=uwe@kleine-koenig.org; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 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-mtd@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220603_140815_680472_76EC0667 X-CRM114-Status: GOOD ( 12.92 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so dev is never NULL. This is a preparation for making platform remove callbacks return void. Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2001:67c:670:201:290:27ff:fe1d:cc33 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so dev is never NULL. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/mtd/devices/spear_smi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index f6febe6662db..f58742486d3d 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -1048,10 +1048,6 @@ static int spear_smi_remove(struct platform_device *pdev) int i; dev = platform_get_drvdata(pdev); - if (!dev) { - dev_err(&pdev->dev, "dev is null\n"); - return -ENODEV; - } /* clean up for all nor flash */ for (i = 0; i < dev->num_flashes; i++) {