From patchwork Fri Oct 20 07:55:23 2023 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: 13430221 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 DC5CFC001DF for ; Fri, 20 Oct 2023 07:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376524AbjJTH50 (ORCPT ); Fri, 20 Oct 2023 03:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376512AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA91810C4 for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003Fk-50; Fri, 20 Oct 2023 09:56:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMx-002yU5-5J; Fri, 20 Oct 2023 09:56:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMw-002OI8-Rp; Fri, 20 Oct 2023 09:56:30 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jonathan Corbet , Rob Herring , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 01/42] crypto: sun4i-ss - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:23 +0200 Message-ID: <20231020075521.2121571-45-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1967; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=nKuAGPRd9IDUbakhgUR3zbuRL2Z/mtNzL+fNYFvWL9k=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJrlbN4nED8DFSFDKbmQXmsN+TM2rd5sYfHK WeADCwuNFmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyawAKCRCPgPtYfRL+ TmmmB/9jC9OJ+rT8evX3EHMDJpBwLkmbXx6vbWLHsN0wI4ujr01XuAPKgrsxG09TJvDL7RYhplc 2VxahrX9osG1xEz69gqjU7a5osP2kMW5SrWBWSSRvKB+YtS22IYtY2aQQ9/pjAJbbB1KImf8h8N zON3DmYGo5lK/Yy6L4bPTzFR3PHGoyRDBCKwVEUr4yRYEpWk3G/FwYb9rvIEwuD+8ldfGwTwsFU 6LDiVFajjzfYOvJHRT90/gXAoptvTr16+FmVqofraAd6mScuZOp9GRNgkFmzqEYLKjsKmrhTDeo CJLmt6LC1DpEbGGf/T78qZ+dPgBJ+9yL0ct+p6Py66YTkFBv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Acked-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c index 3bcfcfc37084..ba80878e2df5 100644 --- a/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c +++ b/drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c @@ -509,7 +509,7 @@ static int sun4i_ss_probe(struct platform_device *pdev) return err; } -static int sun4i_ss_remove(struct platform_device *pdev) +static void sun4i_ss_remove(struct platform_device *pdev) { int i; struct sun4i_ss_ctx *ss = platform_get_drvdata(pdev); @@ -529,7 +529,6 @@ static int sun4i_ss_remove(struct platform_device *pdev) } sun4i_ss_pm_exit(ss); - return 0; } static const struct of_device_id a20ss_crypto_of_match_table[] = { @@ -545,7 +544,7 @@ MODULE_DEVICE_TABLE(of, a20ss_crypto_of_match_table); static struct platform_driver sun4i_ss_driver = { .probe = sun4i_ss_probe, - .remove = sun4i_ss_remove, + .remove_new = sun4i_ss_remove, .driver = { .name = "sun4i-ss", .pm = &sun4i_ss_pm_ops, From patchwork Fri Oct 20 07:55:24 2023 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: 13430211 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 9B5EBC25B40 for ; Fri, 20 Oct 2023 07:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376506AbjJTH5Q (ORCPT ); Fri, 20 Oct 2023 03:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376467AbjJTH44 (ORCPT ); Fri, 20 Oct 2023 03:56:56 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FDDBD78 for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003Fl-51; Fri, 20 Oct 2023 09:56:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMx-002yU8-CR; Fri, 20 Oct 2023 09:56:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIB-2m; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Jonathan Corbet , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:24 +0200 Message-ID: <20231020075521.2121571-46-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1980; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Nebr98eqKliQQ56zYutJMWfjNsqSFr+3DgpmezAGlLM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJsLYW/WVE4mQ+vP/7oGaDrKl3iOmW1VL2xM DRAxq7RrkSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIybAAKCRCPgPtYfRL+ Tu8EB/9GcPBQm9ZA0Z6VwcX8Yih8NfcDa3cOoRj+2aPbM4aEgU3HfMq6TuH6eFMe7zGBCnZtPkM urQuwMQz4csmb8FTp/BxM1fbD9Z1JkrcPH3P7vUvxxJY31wpSKG6N4m4yD9miNkjWtQdRPjaxH4 E7+9vAuY8XnSrtr9YlKqgDULr+uNuj3CEdMdAqiXf/4VTaShVT6Sgr/JtxPjGkgVaL0YyRIgYe5 QlgfthIKrwvI/oDbzMFsbC5qfh4FvanHlyONzr7xuRqi0keJRDtMsfgzBZ9SoS9nzyewTljcBvz gYGNIk1TwSVmqRrfcBYkY8JkDEgGnGly266gKziD0XVpYglU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Acked-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c index d4ccd5254280..1741758e03eb 100644 --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c @@ -1071,7 +1071,7 @@ static int sun8i_ce_probe(struct platform_device *pdev) return err; } -static int sun8i_ce_remove(struct platform_device *pdev) +static void sun8i_ce_remove(struct platform_device *pdev) { struct sun8i_ce_dev *ce = platform_get_drvdata(pdev); @@ -1088,7 +1088,6 @@ static int sun8i_ce_remove(struct platform_device *pdev) sun8i_ce_free_chanlist(ce, MAXFLOW - 1); sun8i_ce_pm_exit(ce); - return 0; } static const struct of_device_id sun8i_ce_crypto_of_match_table[] = { @@ -1110,7 +1109,7 @@ MODULE_DEVICE_TABLE(of, sun8i_ce_crypto_of_match_table); static struct platform_driver sun8i_ce_driver = { .probe = sun8i_ce_probe, - .remove = sun8i_ce_remove, + .remove_new = sun8i_ce_remove, .driver = { .name = "sun8i-ce", .pm = &sun8i_ce_pm_ops, From patchwork Fri Oct 20 07:55:25 2023 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: 13430220 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 1E5CEC07480 for ; Fri, 20 Oct 2023 07:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376511AbjJTH5Z (ORCPT ); Fri, 20 Oct 2023 03:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376490AbjJTH47 (ORCPT ); Fri, 20 Oct 2023 03:56:59 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E84210C7 for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003Fm-50; Fri, 20 Oct 2023 09:56:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMx-002yUB-KE; Fri, 20 Oct 2023 09:56:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIG-Ah; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Jonathan Corbet , Rob Herring , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 03/42] crypto: sun8i-ss - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:25 +0200 Message-ID: <20231020075521.2121571-47-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1986; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=dt3UmLOLBBO2sbhm3wcuiJQjtHH5IgnIOJQ3j1q0V20=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJtGu9EmhrcZ5waKFOIBGm5rNeS0MeowvAWl tQ7nDdLSv+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIybQAKCRCPgPtYfRL+ TogfB/9Kb+cay62DHxbG3K3kjHEidibrgd0CyjH0qk/8cHfHjZkKB53DJMDBKppljtKXEtU5jgP wqWL5n5C9C7wfSt+4P7uoHI//pWbYiHJbhqASPMGq+JmpPlj4MU5rjoNL85lHg3x8oIRsOsRsem tzHZMUMB6v2SBUDv0nekadLOLxdBSRfsniLbfFbY0NSAqShGH2N6sF7917Zb9hguy1HeAvqIOij hNgJneYtnFmnuVfDz7iMYGWLcNo6drvJp7vFztfqoB0V+8jr8HA6dj4aAhBL67C5StACIniMibH IpyvuSTeSdZPCduj6YweaeJx1G6cJdk+/+BR7CmcgneZdHHe X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Acked-by: Corentin Labbe --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c index 4a9587285c04..f14c60359d19 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c @@ -908,7 +908,7 @@ static int sun8i_ss_probe(struct platform_device *pdev) return err; } -static int sun8i_ss_remove(struct platform_device *pdev) +static void sun8i_ss_remove(struct platform_device *pdev) { struct sun8i_ss_dev *ss = platform_get_drvdata(pdev); @@ -921,8 +921,6 @@ static int sun8i_ss_remove(struct platform_device *pdev) sun8i_ss_free_flows(ss, MAXFLOW - 1); sun8i_ss_pm_exit(ss); - - return 0; } static const struct of_device_id sun8i_ss_crypto_of_match_table[] = { @@ -936,7 +934,7 @@ MODULE_DEVICE_TABLE(of, sun8i_ss_crypto_of_match_table); static struct platform_driver sun8i_ss_driver = { .probe = sun8i_ss_probe, - .remove = sun8i_ss_remove, + .remove_new = sun8i_ss_remove, .driver = { .name = "sun8i-ss", .pm = &sun8i_ss_pm_ops, From patchwork Fri Oct 20 07:55:26 2023 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: 13430191 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 108DAC001DF for ; Fri, 20 Oct 2023 07:56:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376433AbjJTH4k (ORCPT ); Fri, 20 Oct 2023 03:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376476AbjJTH4j (ORCPT ); Fri, 20 Oct 2023 03:56:39 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72333D68 for ; Fri, 20 Oct 2023 00:56:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003Fn-2Y; Fri, 20 Oct 2023 09:56:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMx-002yUE-QB; Fri, 20 Oct 2023 09:56:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIK-Gu; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Yu Zhe , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/42] crypto: amcc/crypto4xx - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:26 +0200 Message-ID: <20231020075521.2121571-48-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1954; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XNKWDSvqkqQLMcdxWv9U873dzDpPTq15dIN6KaQ2cHY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJu5xmxHmauusKwyLpMFSQ0vnMn8R8fFUNCD rqa5YotQiiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIybgAKCRCPgPtYfRL+ Tob1B/42u8oqciAR0/yso+MPyVaAZrdJOyhHGrQ2PU2hJO6wHRuCzVZgXTDuPhesLmMiufw3ebg InATn4KnISdfS7IBWUKjN3QalGh0bwWYs6tVxUH1qJ8f7UcZ6O3CfbRZCqKKbcJfUBwzN2U8UkH fPWlhpKR3vIqU7W0TH/cmHblgaWq/Z8Vqrt7jrkL35SR5YRuLJKv/7F/7NfAwI2ObSE+qIWSxaf k73RCV5aNgkwzwmqM06pYj1oyrMjSFc75wbU5xqvKqwXWjHK2AuLx5zbYNAtXluzUZS0+lL8LbI 0eSBy5hG8OWwov5Y7x44YJyaxw9AkzbXPh2cbouQ7sHuN7dF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/amcc/crypto4xx_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index d553f3f1efbe..8d53372245ad 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1507,7 +1507,7 @@ static int crypto4xx_probe(struct platform_device *ofdev) return rc; } -static int crypto4xx_remove(struct platform_device *ofdev) +static void crypto4xx_remove(struct platform_device *ofdev) { struct device *dev = &ofdev->dev; struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); @@ -1523,8 +1523,6 @@ static int crypto4xx_remove(struct platform_device *ofdev) mutex_destroy(&core_dev->rng_lock); /* Free all allocated memory */ crypto4xx_stop_all(core_dev); - - return 0; } static const struct of_device_id crypto4xx_match[] = { @@ -1539,7 +1537,7 @@ static struct platform_driver crypto4xx_driver = { .of_match_table = crypto4xx_match, }, .probe = crypto4xx_probe, - .remove = crypto4xx_remove, + .remove_new = crypto4xx_remove, }; module_platform_driver(crypto4xx_driver); From patchwork Fri Oct 20 07:55:27 2023 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: 13430190 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 D58D8CDB474 for ; Fri, 20 Oct 2023 07:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376462AbjJTH4k (ORCPT ); Fri, 20 Oct 2023 03:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376474AbjJTH4j (ORCPT ); Fri, 20 Oct 2023 03:56:39 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 336E3D5D for ; Fri, 20 Oct 2023 00:56:36 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMy-0003G2-E3; Fri, 20 Oct 2023 09:56:32 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMy-002yUH-0m; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIN-NT; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , linux-crypto@vger.kernel.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 05/42] crypto: amlogic-gxl-core - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:27 +0200 Message-ID: <20231020075521.2121571-49-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1994; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hXDLzoMA+y5An9CnasWFkoxWoOYFEvCz++Cfy0XuFYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJvvN0Q7PlqJK6xoRBrUxyKtBnx/kra+bF0y 8Nd+QigtyKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIybwAKCRCPgPtYfRL+ ThQvB/9o/uBuSUqapZmm9Aei5FfC51JaCF1TbLTRTnkO6/NKxrj7pB47dHjpvhmlrNROqxLA++b iJM4e/jqun7RAwFIocihBaMNdl4PodtEAX/WRN74KskqYsboHZJFC6uKKsc55BOesAJluYyxpL7 F46lHV9GT+8VKwmgbx+jt9qCRsmNs5UYsjyPTsZ2jmw7tvrKVr6Bu1gpOqrxTFqHJPKHiFvnfuu jV+zWdEpxJaYtBJwaX4g0v8XTUW2iLnA5nCMdS3hqiG9QyCpU8mopgqiRW4efBYh0XwUTNFkXL8 +IlI6+pLxpMKB1AaQU6b1Y5ENcS13cyg86yELKIr/xUswT/Y X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Corentin Labbe --- drivers/crypto/amlogic/amlogic-gxl-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c index da6dfe0f9ac3..f54ab0d0b1e8 100644 --- a/drivers/crypto/amlogic/amlogic-gxl-core.c +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c @@ -299,7 +299,7 @@ static int meson_crypto_probe(struct platform_device *pdev) return err; } -static int meson_crypto_remove(struct platform_device *pdev) +static void meson_crypto_remove(struct platform_device *pdev) { struct meson_dev *mc = platform_get_drvdata(pdev); @@ -312,7 +312,6 @@ static int meson_crypto_remove(struct platform_device *pdev) meson_free_chanlist(mc, MAXFLOW - 1); clk_disable_unprepare(mc->busclk); - return 0; } static const struct of_device_id meson_crypto_of_match_table[] = { @@ -323,7 +322,7 @@ MODULE_DEVICE_TABLE(of, meson_crypto_of_match_table); static struct platform_driver meson_crypto_driver = { .probe = meson_crypto_probe, - .remove = meson_crypto_remove, + .remove_new = meson_crypto_remove, .driver = { .name = "gxl-crypto", .of_match_table = meson_crypto_of_match_table, From patchwork Fri Oct 20 07:55:28 2023 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: 13430228 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 40B95C001DF for ; Fri, 20 Oct 2023 07:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376537AbjJTH5x (ORCPT ); Fri, 20 Oct 2023 03:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376535AbjJTH5O (ORCPT ); Fri, 20 Oct 2023 03:57:14 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1551B10D8 for ; Fri, 20 Oct 2023 00:56:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003GA-QE; Fri, 20 Oct 2023 09:56:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMy-002yUK-8R; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMx-002OIS-V6; Fri, 20 Oct 2023 09:56:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Neal Liu , Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 06/42] crypto: aspeed-acry - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:28 +0200 Message-ID: <20231020075521.2121571-50-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1920; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=54Ov1wDXU3uWdC2nv6ZV9WOkI/eETqggVxDYU5WHQUI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJwuPF2/dtX0EWI11lNIxKHUdyZpTjmxblJa OoyE3K9YGuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIycAAKCRCPgPtYfRL+ TjFXB/9s890zmNZddoqEknLAT6f8vBqFGRsKwmrh8nmgWbqnCPGyjgBSCQXmGlBcjCpXpffTGIB G6nzkPrlnNgJrDyfIkwvE9/f+o3UDW+6ZG24Hb3R6EMx/VB/hqd01NIHL62KOB+HIWIMPa8p7gA xcsvni3f0bUqL0julx0F3hYyX1UNBT8n4usY8wrC/TCL7tzwVmIO0mnkvIvwGTvn0N3FySsu2wZ HSg2Zy4X4kMmuhpSh3Yxw2W9wR9SaG3z8hMgG1FOrydkC4FZ34TNKBL3U34qrpRUn8TvjCIecYb aWZ5/CBuh521VBdzssPXGoI9nox8jac2KYnnyL3E9fo7o9or X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Jeffery --- drivers/crypto/aspeed/aspeed-acry.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/aspeed/aspeed-acry.c b/drivers/crypto/aspeed/aspeed-acry.c index 247c568aa8df..b4613bd4ad96 100644 --- a/drivers/crypto/aspeed/aspeed-acry.c +++ b/drivers/crypto/aspeed/aspeed-acry.c @@ -794,7 +794,7 @@ static int aspeed_acry_probe(struct platform_device *pdev) return rc; } -static int aspeed_acry_remove(struct platform_device *pdev) +static void aspeed_acry_remove(struct platform_device *pdev) { struct aspeed_acry_dev *acry_dev = platform_get_drvdata(pdev); @@ -802,15 +802,13 @@ static int aspeed_acry_remove(struct platform_device *pdev) crypto_engine_exit(acry_dev->crypt_engine_rsa); tasklet_kill(&acry_dev->done_task); clk_disable_unprepare(acry_dev->clk); - - return 0; } MODULE_DEVICE_TABLE(of, aspeed_acry_of_matches); static struct platform_driver aspeed_acry_driver = { .probe = aspeed_acry_probe, - .remove = aspeed_acry_remove, + .remove_new = aspeed_acry_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = aspeed_acry_of_matches, From patchwork Fri Oct 20 07:55:29 2023 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: 13430230 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 E1F71C07480 for ; Fri, 20 Oct 2023 07:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376533AbjJTH5y (ORCPT ); Fri, 20 Oct 2023 03:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376536AbjJTH5P (ORCPT ); Fri, 20 Oct 2023 03:57:15 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767EE10D9 for ; Fri, 20 Oct 2023 00:56:51 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003GE-QF; Fri, 20 Oct 2023 09:56:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMy-002yUN-Gw; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMy-002OIb-7Y; Fri, 20 Oct 2023 09:56:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Neal Liu , Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 07/42] crypto: aspeed-hace - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:29 +0200 Message-ID: <20231020075521.2121571-51-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1955; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0YO0s5LXreauqMFpfEjyAZpLsQgNKr0gbAnyprV3vAo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJy3jnWIJF75wjEniVJf9lztk78hAUfW7ZhN wOsZS/iKt2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIycgAKCRCPgPtYfRL+ Ttg/CACG4iqbhG0quRs93JEgKLuQwHqCW3hwSPjBvbphXpp5VtHjN27w/YXL5Np2WoPUPNrVgmw hWLzG5LoZss8FnMu+acBo3Oii3QiqUEkSKilvJntZ0/QawkFoila0LMskRLAuP4yR7IdWqwBm4Y oILFwfy3jJOBMv6pHH4aF0H+4DBYRFYehXHwDtL9Z9bHNqn80SCQKYYhNYpH/FS8zqTrMfeIrPz KEQAkkcx7HcdAsnMF7LRMeoHVp2gEoxl0cD4T1+7J+mu6+yuIVgBC0KzFPtUBqqxNIUlWvovSwe HkQCQbp21lnyB0DNzw5OSg5BQ1vlwbBDeVRzsbUABsSTx5Bj X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Jeffery --- drivers/crypto/aspeed/aspeed-hace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c index d9da04fb816e..062f2a66dd23 100644 --- a/drivers/crypto/aspeed/aspeed-hace.c +++ b/drivers/crypto/aspeed/aspeed-hace.c @@ -245,7 +245,7 @@ static int aspeed_hace_probe(struct platform_device *pdev) return rc; } -static int aspeed_hace_remove(struct platform_device *pdev) +static void aspeed_hace_remove(struct platform_device *pdev) { struct aspeed_hace_dev *hace_dev = platform_get_drvdata(pdev); struct aspeed_engine_crypto *crypto_engine = &hace_dev->crypto_engine; @@ -260,15 +260,13 @@ static int aspeed_hace_remove(struct platform_device *pdev) tasklet_kill(&crypto_engine->done_task); clk_disable_unprepare(hace_dev->clk); - - return 0; } MODULE_DEVICE_TABLE(of, aspeed_hace_of_matches); static struct platform_driver aspeed_hace_driver = { .probe = aspeed_hace_probe, - .remove = aspeed_hace_remove, + .remove_new = aspeed_hace_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = aspeed_hace_of_matches, From patchwork Fri Oct 20 07:55:30 2023 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: 13430199 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 8A923CDB474 for ; Fri, 20 Oct 2023 07:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376469AbjJTH4t (ORCPT ); Fri, 20 Oct 2023 03:56:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376482AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86799D61 for ; Fri, 20 Oct 2023 00:56:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003GF-FX; Fri, 20 Oct 2023 09:56:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMy-002yUR-OK; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMy-002OIf-Eo; Fri, 20 Oct 2023 09:56:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 08/42] crypto: atmel-aes - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:30 +0200 Message-ID: <20231020075521.2121571-52-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1705; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VG2kxo5PvmaCUx6iOVToUnBggD8T7O7zoLc5JcLrN1I=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJzCu44Az4FtpoXYgaSGmC9VzbpD5M+hicAj ZNHL8DuU2CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIycwAKCRCPgPtYfRL+ TiM2B/0X/ausX5WpEDoXqaC3dingGqnmSn0WjvARmPjiZxa9awZGxALKGjAwldVErQWn1BtwlfU 7jxZqMBVJkOEhudATmfo7c6PtZvDfC0WT+CcigVfAJKqcmq/RSR0RdVCwIT6GM3ksYZacrQC1x5 vpC/oNTCMRsqzSc60DsoB4ytD32cjK5rFNrR4n5d6/5FzSzApSaKXH+60EfZDa9tm408XfrU7+e WbihKL/NU0VLwCD7KVOpNNFmvvJEfz884gARl2Ebi1Gk7VMKPEdq/WZpl21xj1JTR8Q8maLc42/ cTdEGB2LhC/441QqqUr0PV8ly301tJPy+SY5T1ohUu8KJX+u X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Hari Prasath Gujulan Elango --- drivers/crypto/atmel-aes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c index 55b5f577b01c..d1d93e897892 100644 --- a/drivers/crypto/atmel-aes.c +++ b/drivers/crypto/atmel-aes.c @@ -2648,7 +2648,7 @@ static int atmel_aes_probe(struct platform_device *pdev) return err; } -static int atmel_aes_remove(struct platform_device *pdev) +static void atmel_aes_remove(struct platform_device *pdev) { struct atmel_aes_dev *aes_dd; @@ -2667,13 +2667,11 @@ static int atmel_aes_remove(struct platform_device *pdev) atmel_aes_buff_cleanup(aes_dd); clk_unprepare(aes_dd->iclk); - - return 0; } static struct platform_driver atmel_aes_driver = { .probe = atmel_aes_probe, - .remove = atmel_aes_remove, + .remove_new = atmel_aes_remove, .driver = { .name = "atmel_aes", .of_match_table = atmel_aes_dt_ids, From patchwork Fri Oct 20 07:55:31 2023 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: 13430192 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 830B6CDB47E for ; Fri, 20 Oct 2023 07:56:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376430AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376463AbjJTH4k (ORCPT ); Fri, 20 Oct 2023 03:56:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8749ED6A for ; Fri, 20 Oct 2023 00:56:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003GY-FW; Fri, 20 Oct 2023 09:56:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMy-002yUU-VP; Fri, 20 Oct 2023 09:56:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMy-002OIj-M8; Fri, 20 Oct 2023 09:56:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 09/42] crypto: atmel-sha - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:31 +0200 Message-ID: <20231020075521.2121571-53-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1734; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6MBLziPLHGBBHG0dQCc2YnPs3iaW4/zbYDK+2XY2HOc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ0pozRpzAhctUodhZ/liuxn3c/9yjaw35fQ KLE8zdA8J+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIydAAKCRCPgPtYfRL+ ThqGB/9fCGeUiA8jOad9Blb0WwuQ6sxTGkhzhgrevaTCxXiGiaModMEgwsQJXwpBRMTyLPAzB3y /+hiCRSK5WG18uMnlvB9GopWRg88haDhOa7k0tFi0L9VyEieUSoWv+Ej4YQe1dpwSgv33h/kTNt B8SdOQl3OQtIOhNkQKR3X+A3JIM9r77Wrwxl/UUqhfqW3/E9MNINxNWazRpM8fBWO6Kgi6pK7Cz CTW/UwAaz0LFvYkh/aekIqOHakVr/hs6VQehiUwumnm0rZa1/upzTZ47634Rcxbdda3+55PT3Bg jNn+YIurFg7IULa/RmXqkJNUHDjOxa/2ylUBc2fY+KX1/PI4 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/atmel-sha.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 3622120add62..ad45af288ece 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2680,7 +2680,7 @@ static int atmel_sha_probe(struct platform_device *pdev) return err; } -static int atmel_sha_remove(struct platform_device *pdev) +static void atmel_sha_remove(struct platform_device *pdev) { struct atmel_sha_dev *sha_dd = platform_get_drvdata(pdev); @@ -2697,13 +2697,11 @@ static int atmel_sha_remove(struct platform_device *pdev) atmel_sha_dma_cleanup(sha_dd); clk_unprepare(sha_dd->iclk); - - return 0; } static struct platform_driver atmel_sha_driver = { .probe = atmel_sha_probe, - .remove = atmel_sha_remove, + .remove_new = atmel_sha_remove, .driver = { .name = "atmel_sha", .of_match_table = atmel_sha_dt_ids, From patchwork Fri Oct 20 07:55:32 2023 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: 13430195 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 1FA0CC001DF for ; Fri, 20 Oct 2023 07:56:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376466AbjJTH4q (ORCPT ); Fri, 20 Oct 2023 03:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376465AbjJTH4l (ORCPT ); Fri, 20 Oct 2023 03:56:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88391D6B for ; Fri, 20 Oct 2023 00:56:37 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkMz-0003Gr-IJ; Fri, 20 Oct 2023 09:56:33 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMz-002yUX-5Q; Fri, 20 Oct 2023 09:56:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMy-002OIn-SK; Fri, 20 Oct 2023 09:56:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 10/42] crypto: atmel-tdes - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:32 +0200 Message-ID: <20231020075521.2121571-54-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1758; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=t+zZKF/41Pj8NMywr8APo/EkmnfD4TbA5Py4GmYqBb0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ1UaIojh+TPeL0s6oCgZLQXSnzxlS5/leo5 9crqTgUZRiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIydQAKCRCPgPtYfRL+ Tu0UB/9woJisdyYJBaNEYFOvHk+plPkoaERjrwAgYCgfR66po9nEO6WEfjW/KsPzb9bzv1qPhxE 5c/9j5TIgoMTL/pb+mJoaKAUwEapFYRBjjEX8YJFc7aUPgjq/Eei7XrruH5cyhDLaKlmMGzKZCd q1XuUmzJSNFAwWmDOzlLfijEvYQSJgvxe8glmA7C1Tw5ButatJGndx08FXn0G9OBPJfzUAOho2r 2k3ml3n4SK5u+bhnUrdVgF99Ldsimv250W5/haTEWFo719x04tkh1RtfBzrmKG3EDXH8IiUpsaC hvSHhdc10DUD0g+JxS2qQZAzZGw6fOQ1et1+vS4H1wQLESVo X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/atmel-tdes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 099b32a10dd7..27b7000e25bc 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -1246,7 +1246,7 @@ static int atmel_tdes_probe(struct platform_device *pdev) return err; } -static int atmel_tdes_remove(struct platform_device *pdev) +static void atmel_tdes_remove(struct platform_device *pdev) { struct atmel_tdes_dev *tdes_dd = platform_get_drvdata(pdev); @@ -1263,13 +1263,11 @@ static int atmel_tdes_remove(struct platform_device *pdev) atmel_tdes_dma_cleanup(tdes_dd); atmel_tdes_buff_cleanup(tdes_dd); - - return 0; } static struct platform_driver atmel_tdes_driver = { .probe = atmel_tdes_probe, - .remove = atmel_tdes_remove, + .remove_new = atmel_tdes_remove, .driver = { .name = "atmel_tdes", .of_match_table = atmel_tdes_dt_ids, From patchwork Fri Oct 20 07:55:33 2023 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: 13430197 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 E8A27C004C0 for ; Fri, 20 Oct 2023 07:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376407AbjJTH4s (ORCPT ); Fri, 20 Oct 2023 03:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376469AbjJTH4l (ORCPT ); Fri, 20 Oct 2023 03:56:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E85E9D6E for ; Fri, 20 Oct 2023 00:56:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN0-0003H0-7P; Fri, 20 Oct 2023 09:56:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMz-002yUe-Bf; Fri, 20 Oct 2023 09:56:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OIr-2L; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Jesper Nilsson , Lars Persson , linux-arm-kernel@axis.com, linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/42] crypto: axis/artpec6 - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:33 +0200 Message-ID: <20231020075521.2121571-55-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1866; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=A9UYMuzGRTiRfFrmuWK1VZNAdlqB7uazUzrs/y2kONU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ2XUru5TuAhNgyQ9BJ3pMSIY3neVWMCTiM5 mOwZj0KqJOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIydgAKCRCPgPtYfRL+ TnMnB/4itlTpse9ngMh3F/2o+x8ALU5Au8ndvV+ziW+Uik6hLdn2vuQ7StCtgkvDWdN3V+guLLp sKq0N2fmv/QdI+TMvc08Tt7XSjUii+dN4oY7APPsRlcaQcduR+xEIhkAjMpn8fWaVSllUbsLOIt gMBhGB1XwFsBojouMy7FNlQbhq/uONPjC1eUi7EdUfzEU9/6JjOku7w6UHkZwkM1IDJLT1uTHyd S7WTSvUMYGYONzbnX/qSn7ZCTE27iiZdm5k9ajwEtFVYl1eQPRMBeVFZsMNIB8wrqfCwYZInLYr ULxZYV6Rg5QCGTygWbg26Kk3xombHq0ijAAXay94jT3zX782 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jesper Nilsson --- drivers/crypto/axis/artpec6_crypto.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c index 8493a45e1bd4..07996b6c3446 100644 --- a/drivers/crypto/axis/artpec6_crypto.c +++ b/drivers/crypto/axis/artpec6_crypto.c @@ -2957,7 +2957,7 @@ static int artpec6_crypto_probe(struct platform_device *pdev) return err; } -static int artpec6_crypto_remove(struct platform_device *pdev) +static void artpec6_crypto_remove(struct platform_device *pdev) { struct artpec6_crypto *ac = platform_get_drvdata(pdev); int irq = platform_get_irq(pdev, 0); @@ -2977,12 +2977,11 @@ static int artpec6_crypto_remove(struct platform_device *pdev) #ifdef CONFIG_DEBUG_FS artpec6_crypto_free_debugfs(); #endif - return 0; } static struct platform_driver artpec6_crypto_driver = { .probe = artpec6_crypto_probe, - .remove = artpec6_crypto_remove, + .remove_new = artpec6_crypto_remove, .driver = { .name = "artpec6-crypto", .of_match_table = artpec6_crypto_of_match, From patchwork Fri Oct 20 07:55:34 2023 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: 13430200 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 53B5AC19F5C for ; Fri, 20 Oct 2023 07:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376473AbjJTH4u (ORCPT ); Fri, 20 Oct 2023 03:56:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376476AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2108F114 for ; Fri, 20 Oct 2023 00:56:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN0-0003I6-4X; Fri, 20 Oct 2023 09:56:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMz-002yUh-Ii; Fri, 20 Oct 2023 09:56:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OIv-9V; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Arnd Bergmann , Rob Herring , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 12/42] crypto: bcm/cipher - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:34 +0200 Message-ID: <20231020075521.2121571-56-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1774; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=grsiWToFgT6aQoiICp8JLE2vEIHkNwFngoCYVPgmLpg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ3rwVHycQzpTPs6O7dSCJ74PKOpigSje2jE DW34UykAL2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIydwAKCRCPgPtYfRL+ TorZCACumE4O8oGA0K0qr8CjCoL6N5SVA2my3TmXdJZ63tzqaIW/B/zz9zIvUKJVQHjQ4E8qo73 0wZVXoAlj57im73vIdbBA7ueKQb2kdaSZKxBz8+FpXU9mEy5UFwZpfvGN6r+Pvl0pyKPL2xC7Al pw8f0YhiYmFSaPRoQR5yg7lMTtfQ6GpsNbUcyIguKeVKtdW2ebBcnhtlWzPIprsjRfP8D4r5OQu EcEmuw6KXov6NmBQIFtX1Izxr1sviDeAG5lkDnzzefXPTNh0T2askvf8hNwQgYMS79jXNA+0axJ ZN8z1MV/PfJXM5ZadLannYXlCGGDFV7RZzK/U4Zqp16Kc8eR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/bcm/cipher.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index 689be70d69c1..10968ddb146b 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -4713,7 +4713,7 @@ static int bcm_spu_probe(struct platform_device *pdev) return err; } -static int bcm_spu_remove(struct platform_device *pdev) +static void bcm_spu_remove(struct platform_device *pdev) { int i; struct device *dev = &pdev->dev; @@ -4751,7 +4751,6 @@ static int bcm_spu_remove(struct platform_device *pdev) } spu_free_debugfs(); spu_mb_release(pdev); - return 0; } /* ===== Kernel Module API ===== */ @@ -4762,7 +4761,7 @@ static struct platform_driver bcm_spu_pdriver = { .of_match_table = of_match_ptr(bcm_spu_dt_ids), }, .probe = bcm_spu_probe, - .remove = bcm_spu_remove, + .remove_new = bcm_spu_remove, }; module_platform_driver(bcm_spu_pdriver); From patchwork Fri Oct 20 07:55:35 2023 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: 13430203 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 4CC0BCDB47E for ; Fri, 20 Oct 2023 07:56:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376482AbjJTH4w (ORCPT ); Fri, 20 Oct 2023 03:56:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376479AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0AD9D51 for ; Fri, 20 Oct 2023 00:56:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN0-0003IY-J1; Fri, 20 Oct 2023 09:56:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMz-002yUn-PH; Fri, 20 Oct 2023 09:56:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OIz-G4; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: =?utf-8?q?Horia_Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 13/42] crypto: caam/jr - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:35 +0200 Message-ID: <20231020075521.2121571-57-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2921; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qu9dDWFjqPcQnsiAS4jgPDl6gmnSq0j6ktjgMno2TbE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ5pFMIl6dHUho0hbeN5kyGWnTaBBjOotTgJ imDRSeh9aSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyeQAKCRCPgPtYfRL+ TushB/9IRcXV5VTYIhfRSh7WUwCOQpYdoc7XrQ8EDKKUWpOVSyq1/iC691EmyHtR05lFQ0ZKUu/ LFTjeoJBMSFKfkSnIt5w8Z+pH8JRftgoKKqZbgK9t/WYgO1zIXSC3IHUZKAyIM63IVUWf7TlT4O Uj51KqB9JiKldbZq5cf2UUznQdbkFakpszHvNzbTRckJlBxx19Au0wYxHhPdJgKZSX/UrPT0jrg 7sQkfpHag6NyH2WvIwyCITgNpjuR0lJlrSEwSgAOjqeYeW4JqIwieg/3xsCjDL6wrjhkObJe6Be 8XRsByGIbY143XfoaT4jENQMMuNRQ3Iygcbumv6Zswcwdex9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The driver adapted here suffers from this wrong assumption. Returning -EBUSY if there are still users results in resource leaks and probably a crash. Also further down passing the error code of caam_jr_shutdown() to the caller only results in another error message and has no further consequences compared to returning zero. Still convert the driver to return no value in the remove callback. This also allows to drop caam_jr_platform_shutdown() as the only function called by it now has the same prototype. Signed-off-by: Uwe Kleine-König --- drivers/crypto/caam/jr.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index b1f1b393b98e..26eba7de3fb0 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c @@ -180,7 +180,7 @@ static int caam_jr_shutdown(struct device *dev) return ret; } -static int caam_jr_remove(struct platform_device *pdev) +static void caam_jr_remove(struct platform_device *pdev) { int ret; struct device *jrdev; @@ -193,11 +193,14 @@ static int caam_jr_remove(struct platform_device *pdev) caam_rng_exit(jrdev->parent); /* - * Return EBUSY if job ring already allocated. + * If a job ring is still allocated there is trouble ahead. Once + * caam_jr_remove() returned, jrpriv will be freed and the registers + * will get unmapped. So any user of such a job ring will probably + * crash. */ if (atomic_read(&jrpriv->tfm_count)) { - dev_err(jrdev, "Device is busy\n"); - return -EBUSY; + dev_alert(jrdev, "Device is busy; consumers might start to crash\n"); + return; } /* Unregister JR-based RNG & crypto algorithms */ @@ -212,13 +215,6 @@ static int caam_jr_remove(struct platform_device *pdev) ret = caam_jr_shutdown(jrdev); if (ret) dev_err(jrdev, "Failed to shut down job ring\n"); - - return ret; -} - -static void caam_jr_platform_shutdown(struct platform_device *pdev) -{ - caam_jr_remove(pdev); } /* Main per-ring interrupt handler */ @@ -823,8 +819,8 @@ static struct platform_driver caam_jr_driver = { .pm = pm_ptr(&caam_jr_pm_ops), }, .probe = caam_jr_probe, - .remove = caam_jr_remove, - .shutdown = caam_jr_platform_shutdown, + .remove_new = caam_jr_remove, + .shutdown = caam_jr_remove, }; static int __init jr_driver_init(void) From patchwork Fri Oct 20 07:55:36 2023 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: 13430222 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 22E35C19F5C for ; Fri, 20 Oct 2023 07:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376525AbjJTH52 (ORCPT ); Fri, 20 Oct 2023 03:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376522AbjJTH5D (ORCPT ); Fri, 20 Oct 2023 03:57:03 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30ECE10CB for ; Fri, 20 Oct 2023 00:56:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN0-0003Iu-Iy; Fri, 20 Oct 2023 09:56:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkMz-002yUq-WF; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OJ3-ND; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Tom Lendacky , John Allen , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 14/42] crypto: ccp/sp - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:36 +0200 Message-ID: <20231020075521.2121571-58-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1836; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ayTLlCQMdSbgn6KWLbeMyIN0n7ue0X/qH6AAgjCJYhw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ6lDm4n7DEbQO3+piwGfVbcBzo0wfVIOPux 5A+K6wYVD+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyegAKCRCPgPtYfRL+ Ti6bB/sEthwblxvCnI4YseV4DMqxpzm4x+F9pcQjlVtV6lsHjYoUtG0BWXRsoQVbCShaASO52SF Lb774dxmCCXd4akQGqXyTD6PjMBcEM9urEVUBvXl5+xm7DaQwbKplGbUkVvgKJP7oxf1/hdpw8P WmLfIkjxsT+pdJgpm7+xJy/VabUVl3Y2kY0EV+8Qu/ALKmMxP2HhDpWc5us8rUIT5l2eZgx/YW3 0FZVivNZYgsL9mOGXDCkz11qAGk+N3dgm/xkvo+FdK/A8MgP0wXEn6vHnzfpl8TR2sQqwxaIZ9E Y4cSdY0nExL7GZnqe3uj6+TlMnbHIU8xujA1JWYYXMWCWuPm X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Tom Lendacky --- drivers/crypto/ccp/sp-platform.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/sp-platform.c b/drivers/crypto/ccp/sp-platform.c index 7d79a8744f9a..473301237760 100644 --- a/drivers/crypto/ccp/sp-platform.c +++ b/drivers/crypto/ccp/sp-platform.c @@ -180,7 +180,7 @@ static int sp_platform_probe(struct platform_device *pdev) return ret; } -static int sp_platform_remove(struct platform_device *pdev) +static void sp_platform_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct sp_device *sp = dev_get_drvdata(dev); @@ -188,8 +188,6 @@ static int sp_platform_remove(struct platform_device *pdev) sp_destroy(sp); dev_notice(dev, "disabled\n"); - - return 0; } #ifdef CONFIG_PM @@ -222,7 +220,7 @@ static struct platform_driver sp_platform_driver = { #endif }, .probe = sp_platform_probe, - .remove = sp_platform_remove, + .remove_new = sp_platform_remove, #ifdef CONFIG_PM .suspend = sp_platform_suspend, .resume = sp_platform_resume, From patchwork Fri Oct 20 07:55:37 2023 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: 13430194 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 B09ECCDB474 for ; Fri, 20 Oct 2023 07:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376474AbjJTH4o (ORCPT ); Fri, 20 Oct 2023 03:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376466AbjJTH4l (ORCPT ); Fri, 20 Oct 2023 03:56:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 886A2D6C for ; Fri, 20 Oct 2023 00:56:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN0-0003JE-PO; Fri, 20 Oct 2023 09:56:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN0-002yUt-68; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkMz-002OJ7-TP; Fri, 20 Oct 2023 09:56:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Gilad Ben-Yossef , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 15/42] crypto: ccree/cc - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:37 +0200 Message-ID: <20231020075521.2121571-59-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1782; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=lejF1Bxw1Ws8DzMMotjuzFXNNQJMw121/Q+2EpVjQDA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ7c43IbLjB7MZVAgapLEjLoYXSb8lH1ygZ2 dmMW5485+aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyewAKCRCPgPtYfRL+ Th1fB/wP9wWwCDsZVZAMTEXbbeZcUaxJYrdczFR5AxprEOdCbCEDWymqEBWZ4uGJsWs6GnQgZCH 8pSFKr/6O7p93H+KimqGqNFqPs/vBxDSS0JFsb9tfgfgwkTWKuL9n+GUZS6QcCQgfaWAGoz2lYg TI5kxCh37weuY4PbpemdiJFg3NE2vKdTia2d45TBNdIaGDmT3GlPDqzKno66g5YhCdSN3GKoPRD 3PJ/67vSQQPiT+FXstIY1OGQTSV9oe561SavpSNKXyFC1DvVLJhxB2u2JlciBU5k6thFvX9toSn NxCYPqvSAYT/ElGx04VqVs3UvSOycdmON4cgJLj9Ins7u9fc X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/ccree/cc_driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c index 0f0694037dd7..9177b54bb0f5 100644 --- a/drivers/crypto/ccree/cc_driver.c +++ b/drivers/crypto/ccree/cc_driver.c @@ -623,7 +623,7 @@ static int ccree_probe(struct platform_device *plat_dev) return 0; } -static int ccree_remove(struct platform_device *plat_dev) +static void ccree_remove(struct platform_device *plat_dev) { struct device *dev = &plat_dev->dev; @@ -632,8 +632,6 @@ static int ccree_remove(struct platform_device *plat_dev) cleanup_cc_resources(plat_dev); dev_info(dev, "ARM ccree device terminated\n"); - - return 0; } static struct platform_driver ccree_driver = { @@ -645,7 +643,7 @@ static struct platform_driver ccree_driver = { #endif }, .probe = ccree_probe, - .remove = ccree_remove, + .remove_new = ccree_remove, }; static int __init ccree_init(void) From patchwork Fri Oct 20 07:55:38 2023 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: 13430193 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 BECE9C004C0 for ; Fri, 20 Oct 2023 07:56:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376488AbjJTH4n (ORCPT ); Fri, 20 Oct 2023 03:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376467AbjJTH4l (ORCPT ); Fri, 20 Oct 2023 03:56:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6E61D6D for ; Fri, 20 Oct 2023 00:56:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003JR-EA; Fri, 20 Oct 2023 09:56:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN0-002yUy-Dk; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJB-4Z; Fri, 20 Oct 2023 09:56:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Krzysztof Kozlowski , Alim Akhtar , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 16/42] crypto: exynos-rng - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:38 +0200 Message-ID: <20231020075521.2121571-60-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1707; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UacrIPwaulEYZNHEF3e9yLVdfE5LSigzPahDQNQWQ9c=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjo5pde1N92UKyW6rnXw0vejNlt0tSkl7JL4fkTJGip Qnbpkh0MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRE2zsf6Xn9l/co8dgNiE2 W3Xi1Pnxs24uOby0MVROt3LuG/WeUB3L/z7sJzj2+Vxof2r9I4lnQl5l3/vPPrcCDuxecoWHyWD vmQrn7XXV2RuipJ2fZBatlu8UL07WeiIZ/vnE1Ek9i6PV9my7vHjRvQNTZG44cM+uWCK4IlRUVN DkZ8A6Ax6vYO9QrYIw4exz57bEvHU8v8C3kb3lgPcpg8oQdpatXt+yttgqNym/y1xnUG7/3v/e2 udnI5/odZ+/o8ijmnT5pNmRoxWvWFLr99vvNu4/7l1j+ZYtktNHqrq5WttZeJuXwC/Fq3bba7as mbnJmsXtH8PBuhfyj7Kswt72SG2bJhPGs+R7JEveP+MPAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti --- drivers/crypto/exynos-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/exynos-rng.c b/drivers/crypto/exynos-rng.c index 5d60a4bcb511..0dd8baf16cb4 100644 --- a/drivers/crypto/exynos-rng.c +++ b/drivers/crypto/exynos-rng.c @@ -306,13 +306,11 @@ static int exynos_rng_probe(struct platform_device *pdev) return ret; } -static int exynos_rng_remove(struct platform_device *pdev) +static void exynos_rng_remove(struct platform_device *pdev) { crypto_unregister_rng(&exynos_rng_alg); exynos_rng_dev = NULL; - - return 0; } static int __maybe_unused exynos_rng_suspend(struct device *dev) @@ -391,7 +389,7 @@ static struct platform_driver exynos_rng_driver = { .of_match_table = exynos_rng_dt_match, }, .probe = exynos_rng_probe, - .remove = exynos_rng_remove, + .remove_new = exynos_rng_remove, }; module_platform_driver(exynos_rng_driver); From patchwork Fri Oct 20 07:55:39 2023 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: 13430196 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 10D1CCDB47E for ; Fri, 20 Oct 2023 07:56:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376465AbjJTH4r (ORCPT ); Fri, 20 Oct 2023 03:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376471AbjJTH4l (ORCPT ); Fri, 20 Oct 2023 03:56:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 192A4106 for ; Fri, 20 Oct 2023 00:56:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003Je-2V; Fri, 20 Oct 2023 09:56:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN0-002yV1-LW; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJF-C7; Fri, 20 Oct 2023 09:56:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Hans Ulli Kroll , Linus Walleij , Corentin Labbe , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 17/42] crypto: gemini/sl3516-ce - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:39 +0200 Message-ID: <20231020075521.2121571-61-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1961; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cXvwJBMSSvZhSYD9MgdQ+cRHZ7jrelKO3QFjEobXMJo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ9nvUOgoLCk56fdwyR2BZYS0yfJPIGl4Cn1 tYTGUJzl0uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyfQAKCRCPgPtYfRL+ ToJACACmuQL+2F6OmzmzLgErfAu4Op4CwkMav8JTjBmlcMytcbXNWIEqLmiIWnotYuWJdg0n957 CReZ6D1nqu+DiLxFANS/1CN4cFn+6Ay3lToX67aYnWpMFvAubQMHkPS/oXgrC8/9TFWt0oEgX/c FRm2neaPsPwMeMIyj864BZIK6TfXenWQOH9HOB18ZjjSBCtPmN2w3lEDj3xi8dLoUvm7RSMYpiU Qygi7oTXu0nvIVlgwXSXRPh//D+ylX4+UJV4vgmlwnf942nxNx6N9zreWWAoHMjR+5YiGzfS3xw zsqFS0WzlWV/hDd5K+GmrTODrpMvg82mi838pUItUzgPpTZW X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Corentin Labbe --- drivers/crypto/gemini/sl3516-ce-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/gemini/sl3516-ce-core.c b/drivers/crypto/gemini/sl3516-ce-core.c index 0f43c6e39bb9..1d1a889599bb 100644 --- a/drivers/crypto/gemini/sl3516-ce-core.c +++ b/drivers/crypto/gemini/sl3516-ce-core.c @@ -505,7 +505,7 @@ static int sl3516_ce_probe(struct platform_device *pdev) return err; } -static int sl3516_ce_remove(struct platform_device *pdev) +static void sl3516_ce_remove(struct platform_device *pdev) { struct sl3516_ce_dev *ce = platform_get_drvdata(pdev); @@ -518,8 +518,6 @@ static int sl3516_ce_remove(struct platform_device *pdev) #ifdef CONFIG_CRYPTO_DEV_SL3516_DEBUG debugfs_remove_recursive(ce->dbgfs_dir); #endif - - return 0; } static const struct of_device_id sl3516_ce_crypto_of_match_table[] = { @@ -530,7 +528,7 @@ MODULE_DEVICE_TABLE(of, sl3516_ce_crypto_of_match_table); static struct platform_driver sl3516_ce_driver = { .probe = sl3516_ce_probe, - .remove = sl3516_ce_remove, + .remove_new = sl3516_ce_remove, .driver = { .name = "sl3516-crypto", .pm = &sl3516_ce_pm_ops, From patchwork Fri Oct 20 07:55:40 2023 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: 13430208 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 5CF56CDB474 for ; Fri, 20 Oct 2023 07:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376516AbjJTH5A (ORCPT ); Fri, 20 Oct 2023 03:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376491AbjJTH4p (ORCPT ); Fri, 20 Oct 2023 03:56:45 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A17A1D55 for ; Fri, 20 Oct 2023 00:56:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003KU-F2; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN0-002yV6-SB; Fri, 20 Oct 2023 09:56:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJJ-JD; Fri, 20 Oct 2023 09:56:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Ruan Jinjie , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 18/42] crypto: hisilicon/sec - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:40 +0200 Message-ID: <20231020075521.2121571-62-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1850; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tZ6e+IH+dxUAavTJYzBY4f+9q0LmXpIohCn9zbxKlLA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjJ+tJhUUEclQTllz+1kqMKs5wsx2si2oL4X9 APxQIvNf9uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyfgAKCRCPgPtYfRL+ Tj4mB/9mWXyd4094WuJ9k5smC3HvVlumKMITHmG8QVnOtjNZ/3yVaD932jKvk38fVFPuoKKk3xW snCLtXCeMzdazbi0nPvj37SfIwO2EUV5fP3Ybdv9pkODgEVS00Ce39Y6Riace5JAfGsoaPE5+tx qqMBbWbG01oYtdncVul8+W2ubdwqtlVzwC3BUCfpmvq1q/S79LK0SXxoMV6T1LLPUERB0zzj01U sLIkNg9wrjzNTyspwjpmzs6mvmh88m5irh1jCJQlzkQ4UggV6PvEilaDJaYUjH3LWHY9EV//w/k n67y+U+GJbcz8WFjQld3zf46ztHow4uefNGUChryPfnTs7es X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/hisilicon/sec/sec_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/hisilicon/sec/sec_drv.c b/drivers/crypto/hisilicon/sec/sec_drv.c index e1e08993de12..afdddf87cc34 100644 --- a/drivers/crypto/hisilicon/sec/sec_drv.c +++ b/drivers/crypto/hisilicon/sec/sec_drv.c @@ -1271,7 +1271,7 @@ static int sec_probe(struct platform_device *pdev) return ret; } -static int sec_remove(struct platform_device *pdev) +static void sec_remove(struct platform_device *pdev) { struct sec_dev_info *info = platform_get_drvdata(pdev); int i; @@ -1287,8 +1287,6 @@ static int sec_remove(struct platform_device *pdev) } sec_base_exit(info); - - return 0; } static const __maybe_unused struct of_device_id sec_match[] = { @@ -1306,7 +1304,7 @@ MODULE_DEVICE_TABLE(acpi, sec_acpi_match); static struct platform_driver sec_driver = { .probe = sec_probe, - .remove = sec_remove, + .remove_new = sec_remove, .driver = { .name = "hisi_sec_platform_driver", .of_match_table = sec_match, From patchwork Fri Oct 20 07:55:41 2023 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: 13430209 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 37B8CC07480 for ; Fri, 20 Oct 2023 07:57:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376498AbjJTH5A (ORCPT ); Fri, 20 Oct 2023 03:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376495AbjJTH4r (ORCPT ); Fri, 20 Oct 2023 03:56:47 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3A3114 for ; Fri, 20 Oct 2023 00:56:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003L4-F3; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN1-002yVA-22; Fri, 20 Oct 2023 09:56:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJN-PF; Fri, 20 Oct 2023 09:56:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Weili Qian , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 19/42] crypto: hisilicon/trng - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:41 +0200 Message-ID: <20231020075521.2121571-63-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2002; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=f5rGnK44f5rPCAkQOF5xAJph5SYzt3jk1ac1yBHvcLg=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjo3oH8yX+PUbGnp7GUVuKWBdzhDveWxDt3hkX03f6s +LKSbqdjMYsDIxcDLJiiiz2jWsyrarkIjvX/rsMM4iVCWQKAxenAExEIJH9v7fC0TrGbTtXKsTY 6Rav7s4JMnGvju89KF3f9UNgOqfF/8jfHdlZzikOatut77emq95VDdoz9VKCcuRjpj8TRQ37fl5 heqjCHDJ3I+vr4ievnUxMrx/dGy7q9uHQ6qlGyUVmlmla9bqebKfmPIm8Iv4kzVWtUHZFepfiTs +wuYdbVhbxbF00ufiFHrvL0oc/1KYXRnPU73+Tv0KLb9fO178FZ7FPWO/WuiY6/dnEbf3bxTKW2 rOV/knv3vpCd5aOpZj8ut6k0DcHdubuS3z26ePMQzoz5k6LCY6YLppkO4+9ZJL3gzOTr8hlpDzb 0ZvLrXY4wtrK9Fy2/Jbbu1e1m3BVFK6bmjBN7ODbVdHdAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Weili Qian --- drivers/crypto/hisilicon/trng/trng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/hisilicon/trng/trng.c b/drivers/crypto/hisilicon/trng/trng.c index 97e500db0a82..451b167bcc73 100644 --- a/drivers/crypto/hisilicon/trng/trng.c +++ b/drivers/crypto/hisilicon/trng/trng.c @@ -303,7 +303,7 @@ static int hisi_trng_probe(struct platform_device *pdev) return ret; } -static int hisi_trng_remove(struct platform_device *pdev) +static void hisi_trng_remove(struct platform_device *pdev) { struct hisi_trng *trng = platform_get_drvdata(pdev); @@ -314,8 +314,6 @@ static int hisi_trng_remove(struct platform_device *pdev) if (trng->ver != HISI_TRNG_VER_V1 && atomic_dec_return(&trng_active_devs) == 0) crypto_unregister_rng(&hisi_trng_alg); - - return 0; } static const struct acpi_device_id hisi_trng_acpi_match[] = { @@ -326,7 +324,7 @@ MODULE_DEVICE_TABLE(acpi, hisi_trng_acpi_match); static struct platform_driver hisi_trng_driver = { .probe = hisi_trng_probe, - .remove = hisi_trng_remove, + .remove_new = hisi_trng_remove, .driver = { .name = "hisi-trng-v2", .acpi_match_table = ACPI_PTR(hisi_trng_acpi_match), From patchwork Fri Oct 20 07:55:42 2023 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: 13430198 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 A1E9AC07480 for ; Fri, 20 Oct 2023 07:56:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376464AbjJTH4s (ORCPT ); Fri, 20 Oct 2023 03:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376473AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8668FD55 for ; Fri, 20 Oct 2023 00:56:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003LG-LY; Fri, 20 Oct 2023 09:56:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN1-002yVE-8y; Fri, 20 Oct 2023 09:56:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN0-002OJR-WC; Fri, 20 Oct 2023 09:56:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 20/42] crypto: img-hash - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:42 +0200 Message-ID: <20231020075521.2121571-64-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=XOlhP2cUnDue0y/xguD/NrllsbeYPsRQcuUgKsHTF74=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjo4bbZ/kuG/P97Iuxnnx7jZffq2lrtxzPjp3MrBsTn 9sqlNLYyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsCNdmb/7/U7+5mR1kkR/oyL 4YV6W75Kzg3/vkzO6aXS4ft7Th3j3nDSf/mOaDO9m//PTL23dX1rn9EL+70pAUZzVvez1zn+uq/ cref09PevNM4t0SvT/HVyas4dN1x+zqHx1DXJ7G9109bHF0f3ZT+5c+CxlPTO8IfS+8NeZXrETt 1X8EmEOzE2qah6S9SrGm+hwx8LG5d57PKOb9eOb/mxxtS83XG6zaccnW5tnqzT3i6HL845oh4S8 i8pVy9ceXpWwuLyHeIK37wDNxWuqDjNpyN4aebK3Nd50f7bHMW2eTBpqcfrFcXtvt2xP4/PXnRW 3CFNUUMD5sVnxGcI8y3ImmIyb9bsa81edrwts+ssp94FAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/img-hash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index 45063693859c..d269036bdaa3 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -1043,7 +1043,7 @@ static int img_hash_probe(struct platform_device *pdev) return err; } -static int img_hash_remove(struct platform_device *pdev) +static void img_hash_remove(struct platform_device *pdev) { struct img_hash_dev *hdev; @@ -1061,8 +1061,6 @@ static int img_hash_remove(struct platform_device *pdev) clk_disable_unprepare(hdev->hash_clk); clk_disable_unprepare(hdev->sys_clk); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1101,7 +1099,7 @@ static const struct dev_pm_ops img_hash_pm_ops = { static struct platform_driver img_hash_driver = { .probe = img_hash_probe, - .remove = img_hash_remove, + .remove_new = img_hash_remove, .driver = { .name = "img-hash-accelerator", .pm = &img_hash_pm_ops, From patchwork Fri Oct 20 07:55:43 2023 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: 13430201 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 D7C11C001DF for ; Fri, 20 Oct 2023 07:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376476AbjJTH4v (ORCPT ); Fri, 20 Oct 2023 03:56:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376483AbjJTH4m (ORCPT ); Fri, 20 Oct 2023 03:56:42 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A093D115 for ; Fri, 20 Oct 2023 00:56:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN1-0003Lm-TP; Fri, 20 Oct 2023 09:56:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN1-002yVH-GX; Fri, 20 Oct 2023 09:56:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN1-002OJV-7V; Fri, 20 Oct 2023 09:56:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Antoine Tenart , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 21/42] crypto: inside-secure/safexcel - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:43 +0200 Message-ID: <20231020075521.2121571-65-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1990; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kCiuHZVacrweSH3xcJRi29kZifyuONrttcMgh3aOsKE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKCgS/5r2l6PZCfzMfnrVkqyEDWL6eP4CyZ5 ZCzhJ4UorCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyggAKCRCPgPtYfRL+ Tp6MCAC37DMAx/xOb9sIzzeKkIztY5w2201ihTSVZTFv5G888xllwboRoeMgXkHfiD/be/9qu2p dMVu2Jyr0otiaAOGwgoYia/tbUMypHSJ85/fU2QZW3xNVfFyjB427kkfvMzfekLBjmd6P8BX26A iG6ZOAvR509TkWzmIfHAC+JyTE4vJQAnN/LZBECP2NHg8tivbxMZweilmOAce1VQfpuLnZ68MOt FouuaLW77aSzCFNj6NkptjDnbSmUWwQbT4MTBhdmPGmYbL+fIg2o7FKalAlJ4hSiIL7TnPbeGFs unjqenQkHqRsw0D5NmliZw6lWyYgBaH1/TZ1ICfrC5ySgSPx X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/inside-secure/safexcel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index 9ff02b5abc4a..76da14af74b5 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -1801,7 +1801,7 @@ static int safexcel_probe(struct platform_device *pdev) return ret; } -static int safexcel_remove(struct platform_device *pdev) +static void safexcel_remove(struct platform_device *pdev) { struct safexcel_crypto_priv *priv = platform_get_drvdata(pdev); int i; @@ -1816,8 +1816,6 @@ static int safexcel_remove(struct platform_device *pdev) irq_set_affinity_hint(priv->ring[i].irq, NULL); destroy_workqueue(priv->ring[i].workqueue); } - - return 0; } static const struct safexcel_priv_data eip97ies_mrvl_data = { @@ -1874,7 +1872,7 @@ MODULE_DEVICE_TABLE(of, safexcel_of_match_table); static struct platform_driver crypto_safexcel = { .probe = safexcel_probe, - .remove = safexcel_remove, + .remove_new = safexcel_remove, .driver = { .name = "crypto-safexcel", .of_match_table = safexcel_of_match_table, From patchwork Fri Oct 20 07:55:44 2023 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: 13430213 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 5095BC07480 for ; Fri, 20 Oct 2023 07:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376505AbjJTH5Q (ORCPT ); Fri, 20 Oct 2023 03:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376483AbjJTH44 (ORCPT ); Fri, 20 Oct 2023 03:56:56 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FC41D76 for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN2-0003M4-Ai; Fri, 20 Oct 2023 09:56:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN1-002yVL-N0; Fri, 20 Oct 2023 09:56:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN1-002OJZ-Dq; Fri, 20 Oct 2023 09:56:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Linus Walleij , Imre Kaloz , Corentin Labbe , linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 22/42] crypto: intel/ixp4xx-crypto - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:44 +0200 Message-ID: <20231020075521.2121571-66-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1997; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Uxql2rquVCiZ+9UkmiKbwvFNTTiK1gqP8jH4odY841c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKDeLUK/o9XlJoJpAG5kRilLG3GuxV1kSDdC 6zYuGrKmQ2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIygwAKCRCPgPtYfRL+ TkvtB/9XPdFWoz/axur5iZKozp63mwB7w6Po/JMSx8oPgw3CJZm66EESprwsMEnpWdB+hNt2InB TBPakAVhB6fdBeYyr2Vv2Q1LyBSWHJwOVEZyr5+MWtu3rTgr5R7aJFHJIEYWoWQg8AazGgOxiNe ePbA2s/9o8y4OiZ+yjn5QJD99IJ5t2sCVAPSd8Or78Q/OXsXlmevwyxb3ZKk9PwkG9oZ/aUUZbu Lb3KT9YOZKf/Td+5jlJZsi9V0sdldwC18eLX2oVCIktR5MqU324ofFkUN8SI07asRo7q0bNwg6j /UO0s0GupRCuM1QrqIqT+z4ZAbLs1ZGPQrFIzsuHZ3moa2nh X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Corentin Labbe --- drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c index 4a18095ae5d8..f8a77bff8844 100644 --- a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c +++ b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c @@ -1563,7 +1563,7 @@ static int ixp_crypto_probe(struct platform_device *_pdev) return 0; } -static int ixp_crypto_remove(struct platform_device *pdev) +static void ixp_crypto_remove(struct platform_device *pdev) { int num = ARRAY_SIZE(ixp4xx_algos); int i; @@ -1578,8 +1578,6 @@ static int ixp_crypto_remove(struct platform_device *pdev) crypto_unregister_skcipher(&ixp4xx_algos[i].crypto); } release_ixp_crypto(&pdev->dev); - - return 0; } static const struct of_device_id ixp4xx_crypto_of_match[] = { { @@ -1590,7 +1588,7 @@ static const struct of_device_id ixp4xx_crypto_of_match[] = { static struct platform_driver ixp_crypto_driver = { .probe = ixp_crypto_probe, - .remove = ixp_crypto_remove, + .remove_new = ixp_crypto_remove, .driver = { .name = "ixp4xx_crypto", .of_match_table = ixp4xx_crypto_of_match, From patchwork Fri Oct 20 07:55:45 2023 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: 13430202 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 045A1C004C0 for ; Fri, 20 Oct 2023 07:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376479AbjJTH4x (ORCPT ); Fri, 20 Oct 2023 03:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376463AbjJTH4n (ORCPT ); Fri, 20 Oct 2023 03:56:43 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C307D46 for ; Fri, 20 Oct 2023 00:56:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN2-0003Me-O1; Fri, 20 Oct 2023 09:56:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN1-002yVR-U7; Fri, 20 Oct 2023 09:56:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN1-002OJd-L7; Fri, 20 Oct 2023 09:56:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Daniele Alessandrelli , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 23/42] crypto: intel/keembay-ocs-aes - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:45 +0200 Message-ID: <20231020075521.2121571-67-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2028; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6Iqa0rT+nQv07AkoPvD1/LNP6FLbiuHF+uJ0vL3pqrM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKEwgNJv+b+gyUgYmyCO58K6fuZtPxcrr/eV gLbWRsB2r2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyhAAKCRCPgPtYfRL+ TsgGB/4smlNe2YNChQBHw42o9dXv3pZ47o9PYPPRXx4XDStqjqBt9g8VrFmIaiD9xG11MLirr/e s2jRCVE8Uy2K5TA0YxW6hRq7YQvVb+o/lNmkEkStIIteXX959EqAdvlZcCWor8CNPrZ5BSBGVu4 021sfwf/ilKEJNrnbZi5/YLtZupzNdOa95lRHRRQXURsc4AxGuiQZd1BSpftqy8QGxY1vF45pjK qlWa8V7tq5RLFS7moxL9lCAZtSIz81dT0r1UX97HJ/dL4ahOwUymhiL8xoctDZWyfuxAI6BZhjE 8vbCVnwgf0+BoI9rCRE8nrzDbadpNN5TCrYxv20bDOXLESrI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/intel/keembay/keembay-ocs-aes-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c b/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c index 1e2fd9a754ec..9b2d098e5eb2 100644 --- a/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c +++ b/drivers/crypto/intel/keembay/keembay-ocs-aes-core.c @@ -1562,7 +1562,7 @@ static const struct of_device_id kmb_ocs_aes_of_match[] = { {} }; -static int kmb_ocs_aes_remove(struct platform_device *pdev) +static void kmb_ocs_aes_remove(struct platform_device *pdev) { struct ocs_aes_dev *aes_dev; @@ -1575,8 +1575,6 @@ static int kmb_ocs_aes_remove(struct platform_device *pdev) spin_unlock(&ocs_aes.lock); crypto_engine_exit(aes_dev->engine); - - return 0; } static int kmb_ocs_aes_probe(struct platform_device *pdev) @@ -1658,7 +1656,7 @@ static int kmb_ocs_aes_probe(struct platform_device *pdev) /* The OCS driver is a platform device. */ static struct platform_driver kmb_ocs_aes_driver = { .probe = kmb_ocs_aes_probe, - .remove = kmb_ocs_aes_remove, + .remove_new = kmb_ocs_aes_remove, .driver = { .name = DRV_NAME, .of_match_table = kmb_ocs_aes_of_match, From patchwork Fri Oct 20 07:55:46 2023 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: 13430223 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 170DFCDB474 for ; Fri, 20 Oct 2023 07:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376578AbjJTH53 (ORCPT ); Fri, 20 Oct 2023 03:57:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376497AbjJTH5A (ORCPT ); Fri, 20 Oct 2023 03:57:00 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E6B9D46 for ; Fri, 20 Oct 2023 00:56:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN3-0003Mu-3l; Fri, 20 Oct 2023 09:56:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN2-002yVV-5W; Fri, 20 Oct 2023 09:56:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN1-002OJh-So; Fri, 20 Oct 2023 09:56:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Daniele Alessandrelli , Prabhjot Khurana , Mark Gross , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 24/42] crypto: intel/keembay-ocs-ecc - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:46 +0200 Message-ID: <20231020075521.2121571-68-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1977; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5gQx1ZgYhOtO1HCzwRB6ysrkrDC4Kp1bds3Fg2Zwn/E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKFEqIrecwxCmDD5/MZRXVrNEOkFqbO6sujG Q5grOwuyR+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyhQAKCRCPgPtYfRL+ TrVFB/9dJjTivaXF4uL1LNFMM6GURMZeoHZ2xf2cKA5LHQfjrLBfAytwaoFsg8LN7KfnnP0vnDB EDdofShIZ6Y4lwmopF9OUNYV1V+lpdeNBo8f3uIWfR25SFfBxcZGfK29kkwpABxmcNQLfFYgUnX d1iv72yaqK6FopSthwXZHNf0sJWPysFGZynS9lpNnM5jdXnhxirhgVxZI64ShczYUfsPUqYW7X9 /87BfEWYDKIr6UYpFYccXzZmHUiL7UetYP2NBVrs3OXjcWCRJkhzQEJf9EX4U+5Fz0txxoWKjmk d4IjrSua/SRsu55hNE6KzPc43nHCTBs2RLS/oGTJYKL14gRE X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/intel/keembay/keembay-ocs-ecc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/intel/keembay/keembay-ocs-ecc.c b/drivers/crypto/intel/keembay/keembay-ocs-ecc.c index fb95deed9057..5e24f2d8affc 100644 --- a/drivers/crypto/intel/keembay/keembay-ocs-ecc.c +++ b/drivers/crypto/intel/keembay/keembay-ocs-ecc.c @@ -964,7 +964,7 @@ static int kmb_ocs_ecc_probe(struct platform_device *pdev) return rc; } -static int kmb_ocs_ecc_remove(struct platform_device *pdev) +static void kmb_ocs_ecc_remove(struct platform_device *pdev) { struct ocs_ecc_dev *ecc_dev; @@ -978,8 +978,6 @@ static int kmb_ocs_ecc_remove(struct platform_device *pdev) spin_unlock(&ocs_ecc.lock); crypto_engine_exit(ecc_dev->engine); - - return 0; } /* Device tree driver match. */ @@ -993,7 +991,7 @@ static const struct of_device_id kmb_ocs_ecc_of_match[] = { /* The OCS driver is a platform device. */ static struct platform_driver kmb_ocs_ecc_driver = { .probe = kmb_ocs_ecc_probe, - .remove = kmb_ocs_ecc_remove, + .remove_new = kmb_ocs_ecc_remove, .driver = { .name = DRV_NAME, .of_match_table = kmb_ocs_ecc_of_match, From patchwork Fri Oct 20 07:55:47 2023 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: 13430226 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 D78B3C07480 for ; Fri, 20 Oct 2023 07:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376518AbjJTH5b (ORCPT ); Fri, 20 Oct 2023 03:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376517AbjJTH5A (ORCPT ); Fri, 20 Oct 2023 03:57:00 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE1610C9 for ; Fri, 20 Oct 2023 00:56:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN2-0003N1-PL; Fri, 20 Oct 2023 09:56:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN2-002yVY-CL; Fri, 20 Oct 2023 09:56:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OJl-3N; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Daniele Alessandrelli , Declan Murphy , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 25/42] crypto: intel/keembay-ocs-hcu - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:47 +0200 Message-ID: <20231020075521.2121571-69-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2078; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=AtYRt9Lgbk2X8ie83TNT0+RrJhu72yEL46Pi6Bon1Gk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKG1TpZh51pkvN52fSb+bnVcCtm2Ll7MgvTK S2shPXXA72JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyhgAKCRCPgPtYfRL+ TvUfB/43IsQ4yCezOIUofXy78bcHjR2igQAcvtoHBD3Obw6YIlQia6bt2SkEjMwLif6/oIajPxi d/l6zbJovLTVocvPuzYWbeGYIVZRJg/OE6bcnoA3TCc9OV8lYfXnl0kpORzRaRmbDRI5wKFCiFl 0Ve9C5seKsFFPKb7CLw34LYqM/8bKztY/VM25zSCj1suZmk24OCySDFlmdHF883kb67TbA0IOSD svcIjqV7ZfPPBlYl84PgJ38IOr3hrvchd5WweyjkpDaTsm+nl1ZrqdijnbIbm79OscVNjiPytdJ CI9ex/i0hVozzJK7vkZ9PaPL9p3C5wrSdlQHW/12mM4w6o9e X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c b/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c index 8a39f959bb53..c2dfca73fe4e 100644 --- a/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c +++ b/drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c @@ -1151,7 +1151,7 @@ static const struct of_device_id kmb_ocs_hcu_of_match[] = { {} }; -static int kmb_ocs_hcu_remove(struct platform_device *pdev) +static void kmb_ocs_hcu_remove(struct platform_device *pdev) { struct ocs_hcu_dev *hcu_dev = platform_get_drvdata(pdev); @@ -1162,8 +1162,6 @@ static int kmb_ocs_hcu_remove(struct platform_device *pdev) spin_lock_bh(&ocs_hcu.lock); list_del(&hcu_dev->list); spin_unlock_bh(&ocs_hcu.lock); - - return 0; } static int kmb_ocs_hcu_probe(struct platform_device *pdev) @@ -1244,7 +1242,7 @@ static int kmb_ocs_hcu_probe(struct platform_device *pdev) /* The OCS driver is a platform device. */ static struct platform_driver kmb_ocs_hcu_driver = { .probe = kmb_ocs_hcu_probe, - .remove = kmb_ocs_hcu_remove, + .remove_new = kmb_ocs_hcu_remove, .driver = { .name = DRV_NAME, .of_match_table = kmb_ocs_hcu_of_match, From patchwork Fri Oct 20 07:55:48 2023 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: 13430215 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 A254AC25B46 for ; Fri, 20 Oct 2023 07:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376471AbjJTH5V (ORCPT ); Fri, 20 Oct 2023 03:57:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376510AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A850310C0 for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN3-0003Oc-JE; Fri, 20 Oct 2023 09:56:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN2-002yVc-Jk; Fri, 20 Oct 2023 09:56:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OJo-AO; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Boris Brezillon , Arnaud Ebalard , Srujana Challa , linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 26/42] crypto: marvell/cesa - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:48 +0200 Message-ID: <20231020075521.2121571-70-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1922; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6/mekkNftzwudJnDp+ayKGLUFukuF70iCc+RyTfGCl0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKH35mmK2h6c1THNe+mOklYN8Fa9bAn2mWcV NkPQImQ4WuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyhwAKCRCPgPtYfRL+ TkLMB/9DybuzvkODxPD+8OYynFZIS065cMgS7OBEMR/pWgy4BJxEahhtgCBO7XFncrnq5vM+ES3 Q6UGA4XEH/IJst7ok7+YdXwOJHN91fbk5AUSeiZXK+EeaUvEWPvvR0/Pw36dQO32p77OnR15JGV QCni/bG27Zbu9S69/G3LP8LgFzmI62TbyvmQ9TE5FHin37a6Ta/LRAGn8m0rwy9bchruM02JvB+ pZr9OPcHc4371yUTTy6leKw7hDIEklkyNMtLZRYtsfooTkTGgl8YqOt2YbmgyYSJrUUNOsMUIBO H0Yb5hmufbkB0zx7nSUvZyZADxyg/FcD9flt4yRsADpQC/8b X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/marvell/cesa/cesa.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index b61e35b932e5..5744df30c838 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -581,7 +581,7 @@ static int mv_cesa_probe(struct platform_device *pdev) return ret; } -static int mv_cesa_remove(struct platform_device *pdev) +static void mv_cesa_remove(struct platform_device *pdev) { struct mv_cesa_dev *cesa = platform_get_drvdata(pdev); int i; @@ -594,8 +594,6 @@ static int mv_cesa_remove(struct platform_device *pdev) mv_cesa_put_sram(pdev, i); irq_set_affinity_hint(cesa->engines[i].irq, NULL); } - - return 0; } static const struct platform_device_id mv_cesa_plat_id_table[] = { @@ -606,7 +604,7 @@ MODULE_DEVICE_TABLE(platform, mv_cesa_plat_id_table); static struct platform_driver marvell_cesa = { .probe = mv_cesa_probe, - .remove = mv_cesa_remove, + .remove_new = mv_cesa_remove, .id_table = mv_cesa_plat_id_table, .driver = { .name = "marvell-cesa", From patchwork Fri Oct 20 07:55:49 2023 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: 13430212 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 377E3CDB47E for ; Fri, 20 Oct 2023 07:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376574AbjJTH5R (ORCPT ); Fri, 20 Oct 2023 03:57:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376481AbjJTH44 (ORCPT ); Fri, 20 Oct 2023 03:56:56 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FFCCD79 for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN3-0003Qd-Ku; Fri, 20 Oct 2023 09:56:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN2-002yVf-Ql; Fri, 20 Oct 2023 09:56:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OJt-HX; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 27/42] crypto: mxs-dcp - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:49 +0200 Message-ID: <20231020075521.2121571-71-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1804; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=euiLVQrUUXCOfCIx3yamKs26fh4H9DHuPQAvDF0cDww=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKIe9EuOxceKf3mTup3FOp9F3FwD/STwHdKC 1EDcX4AGOKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyiAAKCRCPgPtYfRL+ TmlzB/9gJk8y36NTUUzciGQPyj+/VCpLmi3nzzIl19e67hqbo90JYWcPtCzq9TxmCeAScyxK4kf LdsQBigCwEZVhsXa8vvsEIx2xLgPETYULvGjOPNgi8WzWhSZGtmLOo763fFy3FN3hkyhe/j+6WC TphMd7yrn005uCqT2FS37/C/KgGZZ/kBLCoUGoqoOBIWg772TQJvx+93CAGIPB4izPv48O4AzZv e3zoXQTxlRe3aIGF2131M2u4nSj+Sxe/UgwO1PwEilQHGU6vRPFmzJh4yJIKVwMz2w3A8D8Srkh ji/RmtKSVRs3kg9TMFtYb7PlbK7EFJlq9rzXLTkh2lSy5Tvj X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/mxs-dcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c index f6b7bce0e656..d41efddbc772 100644 --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c @@ -1131,7 +1131,7 @@ static int mxs_dcp_probe(struct platform_device *pdev) return ret; } -static int mxs_dcp_remove(struct platform_device *pdev) +static void mxs_dcp_remove(struct platform_device *pdev) { struct dcp *sdcp = platform_get_drvdata(pdev); @@ -1150,8 +1150,6 @@ static int mxs_dcp_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); global_sdcp = NULL; - - return 0; } static const struct of_device_id mxs_dcp_dt_ids[] = { @@ -1164,7 +1162,7 @@ MODULE_DEVICE_TABLE(of, mxs_dcp_dt_ids); static struct platform_driver mxs_dcp_driver = { .probe = mxs_dcp_probe, - .remove = mxs_dcp_remove, + .remove_new = mxs_dcp_remove, .driver = { .name = "mxs-dcp", .of_match_table = mxs_dcp_dt_ids, From patchwork Fri Oct 20 07:55:50 2023 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: 13430204 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 5E94DCDB474 for ; Fri, 20 Oct 2023 07:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376463AbjJTH4y (ORCPT ); Fri, 20 Oct 2023 03:56:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376472AbjJTH4n (ORCPT ); Fri, 20 Oct 2023 03:56:43 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 206E2D6A for ; Fri, 20 Oct 2023 00:56:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003SF-9o; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVk-1k; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OJx-Ou; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 28/42] crypto: n2_core - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:50 +0200 Message-ID: <20231020075521.2121571-72-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2526; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=T4Bo9aTX+eT4XZxS9Uehb5DGE6qoa9vfLkG/lQm8P1E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKKp+r8wGWeqt4VxnCEQ9YZACBc7wPHtBPkm kRXZyTwAs6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyigAKCRCPgPtYfRL+ TvgbCACSH5chw0ZKkC5YttaWCAz0z59H0nBEzc3DIYKZIwiWniZ05ijUkV9nMcd/oFBbdHuvOCF W7xAhlFdBHu4d79xUI6UxPiYJeF7Qcz3bN80LxZ+w6n82xsPwDcnaBXyPpHzC9T9iS/uuASxH6M 0SH+/XHcXUkBB/GWC59LGZ+/0AL/O+AhX1sZKHeJm6X3Q9GGZAlhTnH8ygH4Je+Egyj+659E6QT iKctioi0qMeQ1C/F3TaWCZrfhid9U65wxW0seOoJVYy14TZJHgAIl3k/KwdpvaZrC7h90des3+e //lnphFKS/TTI8kS2hVD1vnmxFIym58Urigf1RcEvt4IEavY X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/n2_core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index d5a32d71a3e9..caea98622c33 100644 --- a/drivers/crypto/n2_core.c +++ b/drivers/crypto/n2_core.c @@ -2011,7 +2011,7 @@ static int n2_crypto_probe(struct platform_device *dev) return err; } -static int n2_crypto_remove(struct platform_device *dev) +static void n2_crypto_remove(struct platform_device *dev) { struct n2_crypto *np = dev_get_drvdata(&dev->dev); @@ -2022,8 +2022,6 @@ static int n2_crypto_remove(struct platform_device *dev) release_global_resources(); free_n2cp(np); - - return 0; } static struct n2_mau *alloc_ncp(void) @@ -2109,7 +2107,7 @@ static int n2_mau_probe(struct platform_device *dev) return err; } -static int n2_mau_remove(struct platform_device *dev) +static void n2_mau_remove(struct platform_device *dev) { struct n2_mau *mp = dev_get_drvdata(&dev->dev); @@ -2118,8 +2116,6 @@ static int n2_mau_remove(struct platform_device *dev) release_global_resources(); free_ncp(mp); - - return 0; } static const struct of_device_id n2_crypto_match[] = { @@ -2146,7 +2142,7 @@ static struct platform_driver n2_crypto_driver = { .of_match_table = n2_crypto_match, }, .probe = n2_crypto_probe, - .remove = n2_crypto_remove, + .remove_new = n2_crypto_remove, }; static const struct of_device_id n2_mau_match[] = { @@ -2173,7 +2169,7 @@ static struct platform_driver n2_mau_driver = { .of_match_table = n2_mau_match, }, .probe = n2_mau_probe, - .remove = n2_mau_remove, + .remove_new = n2_mau_remove, }; static struct platform_driver * const drivers[] = { From patchwork Fri Oct 20 07:55:51 2023 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: 13430205 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 5B0E4C07480 for ; Fri, 20 Oct 2023 07:56:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376472AbjJTH4z (ORCPT ); Fri, 20 Oct 2023 03:56:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376467AbjJTH4n (ORCPT ); Fri, 20 Oct 2023 03:56:43 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FFE4106 for ; Fri, 20 Oct 2023 00:56:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003Tq-B7; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVo-8G; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN2-002OK1-VP; Fri, 20 Oct 2023 09:56:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 29/42] crypto: omap-aes - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:51 +0200 Message-ID: <20231020075521.2121571-73-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1883; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GKy4UtuJ6e6gFts6Mio5i90aXaN7ynJnTKASBctbdbs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKLdsXF/q9eHBxPHTnp52EtFzUFVr4FLpg7Z OUgTx2k+O2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyiwAKCRCPgPtYfRL+ Tlj9CACGc7nSgwGQvGiiWoWFoVJqwKynGlf2xuChyVPdCam2bsQmssyCUSpA2fXw5elODXK9Gd+ WLJd6wTWQIc9PRCbzJrAnKW4KEmiopz9YAL4KV9RvV6ej0ng9nXa+r0MLkOltZvwXqqRqIaG8eH Xjzr7eRdtIqH3mR/DFAVqHcZzifMPk6jIFTHnT2AyAGZ8hrVEC9OUfZ/seJGOxc9iUv+F/sUO0/ R8AaekkED8axSUfyT+vsK346sC0EzTMKxpjoUla/mPxzvZKd7+CLv6zYYVwU/tDmVFY+N0D/RKk ge6cJRT7xOVC77NziC9A3nIvzxzMXPXLOHtTLXqYgGmUcT/r X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/omap-aes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c index ed83023dd77a..bad1adacbc84 100644 --- a/drivers/crypto/omap-aes.c +++ b/drivers/crypto/omap-aes.c @@ -1255,7 +1255,7 @@ static int omap_aes_probe(struct platform_device *pdev) return err; } -static int omap_aes_remove(struct platform_device *pdev) +static void omap_aes_remove(struct platform_device *pdev) { struct omap_aes_dev *dd = platform_get_drvdata(pdev); struct aead_engine_alg *aalg; @@ -1285,8 +1285,6 @@ static int omap_aes_remove(struct platform_device *pdev) pm_runtime_disable(dd->dev); sysfs_remove_group(&dd->dev->kobj, &omap_aes_attr_group); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1307,7 +1305,7 @@ static SIMPLE_DEV_PM_OPS(omap_aes_pm_ops, omap_aes_suspend, omap_aes_resume); static struct platform_driver omap_aes_driver = { .probe = omap_aes_probe, - .remove = omap_aes_remove, + .remove_new = omap_aes_remove, .driver = { .name = "omap-aes", .pm = &omap_aes_pm_ops, From patchwork Fri Oct 20 07:55:52 2023 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: 13430206 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 49AE4C004C0 for ; Fri, 20 Oct 2023 07:56:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376492AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376489AbjJTH4p (ORCPT ); Fri, 20 Oct 2023 03:56:45 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91FFF115 for ; Fri, 20 Oct 2023 00:56:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003Wl-Jo; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVr-GC; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN3-002OK5-7A; Fri, 20 Oct 2023 09:56:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 30/42] crypto: omap-des - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:52 +0200 Message-ID: <20231020075521.2121571-74-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7jd/KTl/DuQ/eWYNI6pmYZCSZAZtYSaW3wam/creYY0=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjox6ud9yeQksnXPHlcIwMt+BK+5Hpkn6yVSt7ZsQDv TVvcn52MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCRgh3sf/iWnpRXeFrVUd10 TVuUUX59iM9pEQ4JXWtF5l7v5xeuMZf366yS0d5Tt33N6efLe6ecfB8u/HrBNCudKUt+GeRW7ns 1a0+ofXxOnZbWz4uGXQIf2Q8FCBsrczJsPub21+kN31aFD4tP5L5VEXSdd+re/jhh+zi7JPf2nO oahbQ116eLnhWWNI7RnLd6ToNmr5n/zY67Ru7rVsrFVIS8ZLtuF61wgdXhtHf8bRbD24dubpsQO cGqerG9YWCJaXBU34rCabvPvL97SXHbvX/PBBg6zspefrZU+oqLX4ZEzqmMTMP9z2P1ZoRw271k UuLOdxKdNykzZr2P9/cfdT9+9kSmiH1gdH680lFh56RaAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/omap-des.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c index 089dd45eaedd..209d3dc03a9b 100644 --- a/drivers/crypto/omap-des.c +++ b/drivers/crypto/omap-des.c @@ -1072,7 +1072,7 @@ static int omap_des_probe(struct platform_device *pdev) return err; } -static int omap_des_remove(struct platform_device *pdev) +static void omap_des_remove(struct platform_device *pdev) { struct omap_des_dev *dd = platform_get_drvdata(pdev); int i, j; @@ -1089,8 +1089,6 @@ static int omap_des_remove(struct platform_device *pdev) tasklet_kill(&dd->done_task); omap_des_dma_cleanup(dd); pm_runtime_disable(dd->dev); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1117,7 +1115,7 @@ static SIMPLE_DEV_PM_OPS(omap_des_pm_ops, omap_des_suspend, omap_des_resume); static struct platform_driver omap_des_driver = { .probe = omap_des_probe, - .remove = omap_des_remove, + .remove_new = omap_des_remove, .driver = { .name = "omap-des", .pm = &omap_des_pm_ops, From patchwork Fri Oct 20 07:55:53 2023 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: 13430207 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 1E713C001DF for ; Fri, 20 Oct 2023 07:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376489AbjJTH47 (ORCPT ); Fri, 20 Oct 2023 03:56:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376494AbjJTH4r (ORCPT ); Fri, 20 Oct 2023 03:56:47 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 235A9D61 for ; Fri, 20 Oct 2023 00:56:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN4-0003Xi-TD; Fri, 20 Oct 2023 09:56:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVu-NX; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN3-002OKE-EP; Fri, 20 Oct 2023 09:56:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 31/42] crypto: omap-sham - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:53 +0200 Message-ID: <20231020075521.2121571-75-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1743; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=eE5FmpD4VkhilJ2UozoC4CPBw/DQyfZFnxmpvFi/8GU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKNKHy7ORltp/8iBKZ/mUKFSlOQJoZ5gPMTu COQYTAgnBaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyjQAKCRCPgPtYfRL+ TiWIB/0UeEKpHSux8TLGIXhVVku6FatGM+0GXA9gTludVWbgEROfC9KXR0C8GJJ5uVOCYYiOdIh 99fp2kK1ycZC9B6GuvJjC26D98OMxTvrmqaB//Z2JCFk1i0oBpE4NKCJJgaVgPYkZ7CD3RG1Zkx kq2X36/v1DsVlm5jdBG+7ab57s17eonng31U7Co11RbUXo9eCiO4EEkav3w7PnRro0z7Zt3psH8 L3Dh3Gqx0n9EAYA6ZFmZ+v7qI99efcAvFdkUkMPmEd6rzYKCAteULniy9hkyLxqxGhF+9uep5Ny G7bs5h9vLO8T01E1pvMosZQRmhmPF8Tw0fkPAVLw2J3zENd5 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/omap-sham.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index a6b4a0b3ace3..496602f7caa5 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -2200,7 +2200,7 @@ static int omap_sham_probe(struct platform_device *pdev) return err; } -static int omap_sham_remove(struct platform_device *pdev) +static void omap_sham_remove(struct platform_device *pdev) { struct omap_sham_dev *dd; int i, j; @@ -2224,13 +2224,11 @@ static int omap_sham_remove(struct platform_device *pdev) dma_release_channel(dd->dma_lch); sysfs_remove_group(&dd->dev->kobj, &omap_sham_attr_group); - - return 0; } static struct platform_driver omap_sham_driver = { .probe = omap_sham_probe, - .remove = omap_sham_remove, + .remove_new = omap_sham_remove, .driver = { .name = "omap-sham", .of_match_table = omap_sham_of_match, From patchwork Fri Oct 20 07:55:54 2023 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: 13430210 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 89C40C004C0 for ; Fri, 20 Oct 2023 07:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376543AbjJTH5P (ORCPT ); Fri, 20 Oct 2023 03:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376504AbjJTH4s (ORCPT ); Fri, 20 Oct 2023 03:56:48 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F879D73 for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN5-0003YZ-Os; Fri, 20 Oct 2023 09:56:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN3-002yVz-Tt; Fri, 20 Oct 2023 09:56:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN3-002OKH-Ki; Fri, 20 Oct 2023 09:56:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Thara Gopinath , linux-crypto@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 32/42] crypto: qce - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:54 +0200 Message-ID: <20231020075521.2121571-76-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1896; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=G0/igmENqnZ6cetBxXxRJSgWvtgANtFuylMhEvhkrEs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKOev/uBpsw9uCPahZqZFYXVWH0XyuLyrZ2n hpZuBDHox+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIyjgAKCRCPgPtYfRL+ TmgqCACzXUPxe9GXPXocrWR3io0dlnoG8qXO+qNu6fd8JiB8sDCgkZbDZ9Xmfq3Ee4FuxB/HVFw wZt2FPa+3jWFZy7lbtaiPTsViNBGtLt+fvZ04pNNfG5XfscPlcS0cBmRTpIFR/CsDadRRXq6h/v UdTkfly25Fc8DYLuGc8dVfkJ+wYlh2YsrJUqd8dRmh7ws9+OlS9PF0AV480Ze2zlwBxmfFfxn9s FojrBd3LBwWanky3ws71R4/wquSF3m3rV1uLFssO1lQmrRNTQCL5TQFK5AXJeHcYkMaJe66ow1a SOEGUl1cvblO0sxdaRdchp1FQE6M+RrFZCpEMhbtPlrWDJ3E X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/qce/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c index fce49c0dee3e..28b5fd823827 100644 --- a/drivers/crypto/qce/core.c +++ b/drivers/crypto/qce/core.c @@ -277,7 +277,7 @@ static int qce_crypto_probe(struct platform_device *pdev) return ret; } -static int qce_crypto_remove(struct platform_device *pdev) +static void qce_crypto_remove(struct platform_device *pdev) { struct qce_device *qce = platform_get_drvdata(pdev); @@ -287,7 +287,6 @@ static int qce_crypto_remove(struct platform_device *pdev) clk_disable_unprepare(qce->bus); clk_disable_unprepare(qce->iface); clk_disable_unprepare(qce->core); - return 0; } static const struct of_device_id qce_crypto_of_match[] = { @@ -300,7 +299,7 @@ MODULE_DEVICE_TABLE(of, qce_crypto_of_match); static struct platform_driver qce_crypto_driver = { .probe = qce_crypto_probe, - .remove = qce_crypto_remove, + .remove_new = qce_crypto_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = qce_crypto_of_match, From patchwork Fri Oct 20 07:55:55 2023 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: 13430224 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 DB829CDB47E for ; Fri, 20 Oct 2023 07:57:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376497AbjJTH5a (ORCPT ); Fri, 20 Oct 2023 03:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376499AbjJTH5E (ORCPT ); Fri, 20 Oct 2023 03:57:04 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E31A1AE for ; Fri, 20 Oct 2023 00:56:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN6-0003ZZ-10; Fri, 20 Oct 2023 09:56:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN4-002yW2-41; Fri, 20 Oct 2023 09:56:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN3-002OKM-R5; Fri, 20 Oct 2023 09:56:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 33/42] crypto: qcom-rng - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:55 +0200 Message-ID: <20231020075521.2121571-77-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1712; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=kUBCXyNhmAOITBuECHTgq8IeakGTUY+qub8iRJK7S1Y=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjo36fAg6P9pJEzqmXDFT7xP8FSyfdUU+ILGvN3FAft U9MZVInozELAyMXg6yYIot945pMqyq5yM61/y7DDGJlApnCwMUpABN53M7B0HKfTWW3nk3DDBND I3vHP8dtY5292nrlHop1eLdMWHYn+hibqqgDR316Q4Vf2pnHwqnlZXrafa5hv/eulpt5cnL/2Zz bFS+vtuakPmPeqXVhvW3yVo+tXu7817OLl/z6uZA1qNvH78iRZ5yzph5iP/u4wc+PzTPJouBMb5 LQvdlG57csd1y4/bSPZZ7KUUbVgHdztnZ7707f3LJrlvYeZxndB4sFJy2uq/+ePvf03aiF0T7dd znTG/7dc3i8yljCdvodgau750zwLyjyyk+YzFRVOu+Vx5SHv2ebeqyrkMpUCrtztjfs2vtDjz4+ 3HZfflL4fNFEe7WZAsUTX1XZ6/nz/6ndc1Bo6orCbjkrAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio --- drivers/crypto/qcom-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/qcom-rng.c b/drivers/crypto/qcom-rng.c index f46b92bb14b5..c670d7d0c11e 100644 --- a/drivers/crypto/qcom-rng.c +++ b/drivers/crypto/qcom-rng.c @@ -224,13 +224,11 @@ static int qcom_rng_probe(struct platform_device *pdev) return ret; } -static int qcom_rng_remove(struct platform_device *pdev) +static void qcom_rng_remove(struct platform_device *pdev) { crypto_unregister_rng(&qcom_rng_alg); qcom_rng_dev = NULL; - - return 0; } static struct qcom_rng_of_data qcom_prng_of_data = { @@ -264,7 +262,7 @@ MODULE_DEVICE_TABLE(of, qcom_rng_of_match); static struct platform_driver qcom_rng_driver = { .probe = qcom_rng_probe, - .remove = qcom_rng_remove, + .remove_new = qcom_rng_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = of_match_ptr(qcom_rng_of_match), From patchwork Fri Oct 20 07:55:56 2023 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: 13430218 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 E5537C25B40 for ; Fri, 20 Oct 2023 07:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376508AbjJTH5X (ORCPT ); Fri, 20 Oct 2023 03:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376514AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A83A3D7F for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN6-0003bJ-Ci; Fri, 20 Oct 2023 09:56:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN4-002yW5-DU; Fri, 20 Oct 2023 09:56:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKQ-47; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Corentin Labbe , Heiko Stuebner , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 34/42] crypto: rockchip/rk3288 - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:56 +0200 Message-ID: <20231020075521.2121571-78-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1829; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OSkAhDdh6kSQDLklGjL3p61jBuTD2vuCyW1G0nBc6KE=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlQjowm3z2mLOVfsj9qseDcuU47JZLU/S4rYGs64R1+3G QvX7/XvZDRmYWDkYpAVU2Sxb1yTaVUlF9m59t9lmEGsTCBTGLg4BWAi7IkcDA3aYiz6ce961hiE fnQ/rRpn3Lb+WmXem0wrEe6KRRwbQs6wbpH46aaR2xKqmeN94pPaf2Umz7PG6ip7rJNa5pcYz5M 7xBPF1OH1Lmk3P/+3MwIrjoZt0Jcsuyv0fsZ60Sl5KvuKJyy8Fv21cesv6/XXMi+aX5hXwZ03T3 TzAYPFHjsS55xZVR16NWn62RTXl0VRqW/lBZr4Km10Fx07rRV69NWVg46R/BpeC132+yrf+XVwe Wr93wPn2a16p1ckB5mrbqpsqK3IuBxkrdzYs7mqqvlhzq7jefVaKpcYahI6biUJ23L8LtloXjCx QTs/LPNT7Mrnq1quP0s2mprkPd3rd8p5NY2fTD/X81UDAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Heiko Stuebner Acked-by: Corentin Labbe --- drivers/crypto/rockchip/rk3288_crypto.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c index 77d5705a5d96..70edf40bc523 100644 --- a/drivers/crypto/rockchip/rk3288_crypto.c +++ b/drivers/crypto/rockchip/rk3288_crypto.c @@ -405,7 +405,7 @@ static int rk_crypto_probe(struct platform_device *pdev) return err; } -static int rk_crypto_remove(struct platform_device *pdev) +static void rk_crypto_remove(struct platform_device *pdev) { struct rk_crypto_info *crypto_tmp = platform_get_drvdata(pdev); struct rk_crypto_info *first; @@ -424,12 +424,11 @@ static int rk_crypto_remove(struct platform_device *pdev) } rk_crypto_pm_exit(crypto_tmp); crypto_engine_exit(crypto_tmp->engine); - return 0; } static struct platform_driver crypto_driver = { .probe = rk_crypto_probe, - .remove = rk_crypto_remove, + .remove_new = rk_crypto_remove, .driver = { .name = "rk3288-crypto", .pm = &rk_crypto_pm_ops, From patchwork Fri Oct 20 07:55:57 2023 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: 13430217 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 74DCEC25B45 for ; Fri, 20 Oct 2023 07:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376484AbjJTH5T (ORCPT ); Fri, 20 Oct 2023 03:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376507AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0702AD7E for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN6-0003ca-Al; Fri, 20 Oct 2023 09:56:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN4-002yWC-JT; Fri, 20 Oct 2023 09:56:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKU-AK; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Krzysztof Kozlowski , Vladimir Zapolskiy , linux-crypto@vger.kernel.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 35/42] crypto: s5p-sss - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:57 +0200 Message-ID: <20231020075521.2121571-79-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1699; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=S6+msUyByijcNmR/6dbk6gp1vCoevLnu2n8OjF7qHUs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKSyP7JzLsaTpPyE7o+SWp4NkvNMIemA+r3f Oye6U4jJcmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIykgAKCRCPgPtYfRL+ TkQsB/45KMnx8+zk/dnRPDl1weTLeVz43FDYP8zbYjWn9Qk+Dt1WUDYhvmdm0hPX7PdBB4E7Ok4 J1rKXX89/U9xLDL1oU65+o5Pb8ZhlSDI/4kBSlKYZq806wM1NHBGRJcphoHGKqLf27JQTSAPmAq KjvU3HaitTZq3BTa98wNp3v6t8O2EK+8sHo13ATua4cT4BGKIZyV/CoXMD467nSqmA2bU3j6pyW 47qqG0Ckp/CuNfXBFLR4xHZlkfSb0DiNYkS/C1AjVBClNI1It1dQHiphjFskspkj06zgnUGo+w5 zLJXFjBZucs+HkJtFv3e6r9tFjmkxSmNnGY/+FFHIbFaiV9c X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index fe8cf9ba8005..9c02046971e3 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -2315,7 +2315,7 @@ static int s5p_aes_probe(struct platform_device *pdev) return err; } -static int s5p_aes_remove(struct platform_device *pdev) +static void s5p_aes_remove(struct platform_device *pdev) { struct s5p_aes_dev *pdata = platform_get_drvdata(pdev); int i; @@ -2337,13 +2337,11 @@ static int s5p_aes_remove(struct platform_device *pdev) clk_disable_unprepare(pdata->clk); s5p_dev = NULL; - - return 0; } static struct platform_driver s5p_aes_crypto = { .probe = s5p_aes_probe, - .remove = s5p_aes_remove, + .remove_new = s5p_aes_remove, .driver = { .name = "s5p-secss", .of_match_table = s5p_sss_dt_match, From patchwork Fri Oct 20 07:55:58 2023 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: 13430214 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 D9ADCC001DF for ; Fri, 20 Oct 2023 07:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376481AbjJTH5S (ORCPT ); Fri, 20 Oct 2023 03:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376508AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066CED7A for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN6-0003dM-Mo; Fri, 20 Oct 2023 09:56:40 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN4-002yWG-Pg; Fri, 20 Oct 2023 09:56:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKX-Ga; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 36/42] crypto: sa2ul - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:58 +0200 Message-ID: <20231020075521.2121571-80-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1686; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Aq3je/SuIFI0BUC/13Ds8/g4ZpAP1by27NY2YIFlN6Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKTXY1jCFSa5bsS59e3knZYxtJ8qeIoRr195 BTcqfhshoCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIykwAKCRCPgPtYfRL+ TjZsB/0QSrCYq9FWZarcHBDbAOZtbTKic7kNHj+liJ0TKBXoRj5HG4iHG9drMQvZB8LuXHrLhwF MZMGNJACtpBacQjQiAmr+awzGeEI+0xVZvNy//zFVgQaF1Id/raxyrzFInAuMFI5MZPCntZ2YjK vmR7Sf91+cbSw/BIoUJcEG5ev6ZXAWgk4ViS9WgOF9bXlxJyPPkb7A2l9PYsAWNNI9q3zqTHeIh oqca3DTdtH3NvrQgdw3PzCGvCDzLTK1VTCzmvcoJVBvsxzO2oX32zY4X/+fLV7LLrIxW28Ini/e wGdjxmV1AW2nEHNenxei7HzYJM5CrGXvFa71yM3vej7vYtAq X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/sa2ul.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index 6238d34f8db2..6846a8429574 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -2468,7 +2468,7 @@ static int sa_ul_probe(struct platform_device *pdev) return ret; } -static int sa_ul_remove(struct platform_device *pdev) +static void sa_ul_remove(struct platform_device *pdev) { struct sa_crypto_data *dev_data = platform_get_drvdata(pdev); @@ -2486,13 +2486,11 @@ static int sa_ul_remove(struct platform_device *pdev) pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); - - return 0; } static struct platform_driver sa_ul_driver = { .probe = sa_ul_probe, - .remove = sa_ul_remove, + .remove_new = sa_ul_remove, .driver = { .name = "saul-crypto", .of_match_table = of_match, From patchwork Fri Oct 20 07:55:59 2023 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: 13430216 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 B6C54C25B47 for ; Fri, 20 Oct 2023 07:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376507AbjJTH5X (ORCPT ); Fri, 20 Oct 2023 03:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376509AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06752D7B for ; Fri, 20 Oct 2023 00:56:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN7-0003eq-0Z; Fri, 20 Oct 2023 09:56:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN5-002yWJ-0l; Fri, 20 Oct 2023 09:56:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKc-Nc; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 37/42] crypto: sahara - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:55:59 +0200 Message-ID: <20231020075521.2121571-81-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1678; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=IasulRNGt6hUp9eOT/ON/572KWT+hDQFEcV0wFuffAc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKUy64U3nQiv6h6xRWyHVOOSC2vgjfTB2OVY vXLy3iUgxCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIylAAKCRCPgPtYfRL+ TgV+B/4jhV2EAsqgPvffQYyILW5lSt+VH76/zkYYSP3B7hWmZ1hoip1kVp5VJZy/v/7JlZtZBMp VrsQZkQmOwvTz35RcM7bylL3N/X1Xlrn0stlPXkf8W4BTsm8O7VmCW8fyqfU+diVzyr8ZstwrSJ +tqJPpmcNh79Seg6LyToHnn51aTznc7HfcHSjickZuZlRt/EHuxngsReqTqeKw79udjo7ddGEXi irf9ZGWywaZbnTF+HO8QoyCBPiYRTLX6LjtgjTfJhi84rt9doU6ssiCTmQ/5jSrT6jpaXsM0M1g RETiSKZ6kYroZ8pPLqyRdWCaCWmDKFklxiXKX+8+mPY4xzYw X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/sahara.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c index 62d93526920f..02065131c300 100644 --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c @@ -1510,7 +1510,7 @@ static int sahara_probe(struct platform_device *pdev) return err; } -static int sahara_remove(struct platform_device *pdev) +static void sahara_remove(struct platform_device *pdev) { struct sahara_dev *dev = platform_get_drvdata(pdev); @@ -1522,13 +1522,11 @@ static int sahara_remove(struct platform_device *pdev) clk_disable_unprepare(dev->clk_ahb); dev_ptr = NULL; - - return 0; } static struct platform_driver sahara_driver = { .probe = sahara_probe, - .remove = sahara_remove, + .remove_new = sahara_remove, .driver = { .name = SAHARA_NAME, .of_match_table = sahara_dt_ids, From patchwork Fri Oct 20 07:56:00 2023 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: 13430225 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 054B3C004C0 for ; Fri, 20 Oct 2023 07:57:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376499AbjJTH5a (ORCPT ); Fri, 20 Oct 2023 03:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376518AbjJTH5A (ORCPT ); Fri, 20 Oct 2023 03:57:00 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA76D51 for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN7-0003gL-4A; Fri, 20 Oct 2023 09:56:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN5-002yWN-8V; Fri, 20 Oct 2023 09:56:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN4-002OKg-Ty; Fri, 20 Oct 2023 09:56:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Maxime Coquelin , Alexandre Torgue , linux-crypto@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 38/42] crypto: stm32/crc32 - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:56:00 +0200 Message-ID: <20231020075521.2121571-82-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2434; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ZSdL5qT5fdKkW9Pe3nwuWzBPi3/kxcjn33Eoon/bjiY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKVcsA+sPV86Y9njfUYUKL2nE/mN1rlIOD2i PhmFZ870pCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIylQAKCRCPgPtYfRL+ TplEB/47NfS/xSFI1GP3PNeDNFXa2FAvxzpE7r6IO4SOZETJVdSmjn4CeyG+yIXfoAqN6qnnnE1 yrQJkFRUoy+O24ytc7I+Hz3ViZnQ+9znfTExxA6boeskmTSuQuJ92EKVv8coIHWFqJ0XzpVQ87B rO/KDO/EpWY8OqWQpVWa97GQNoAixLjM9+FrUwhjDsgykpJFwUkWeS/BkACG/bVkAf8uZs19Ya+ 2NWMcwVTR9v/qep5rhn5Pylt5dwTt1lXag5uBe+/rH16Rb7rT/WUYpNskHBVxg6AEtrUcmMJeWz pjqcSYZCOkC9gX2BhqKtgigQWPfFLsx062Kweb/Kph/hZpfz X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The driver adapted here suffered from this wrong assumption and had an error paths resulting in resource leaks. If pm_runtime_get() fails, the other resources held by the device must still be freed. Only clk_disable() should be skipped as the pm_runtime_get() failed to call clk_enable(). After this change the remove function returns zero unconditionally and can trivially be converted to the prototype required for .remove_new(). Signed-off-by: Uwe Kleine-König --- drivers/crypto/stm32/stm32-crc32.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/stm32/stm32-crc32.c b/drivers/crypto/stm32/stm32-crc32.c index 90a920e7f664..5d1067c8cb0d 100644 --- a/drivers/crypto/stm32/stm32-crc32.c +++ b/drivers/crypto/stm32/stm32-crc32.c @@ -379,16 +379,11 @@ static int stm32_crc_probe(struct platform_device *pdev) return 0; } -static int stm32_crc_remove(struct platform_device *pdev) +static void stm32_crc_remove(struct platform_device *pdev) { struct stm32_crc *crc = platform_get_drvdata(pdev); int ret = pm_runtime_get_sync(crc->dev); - if (ret < 0) { - pm_runtime_put_noidle(crc->dev); - return ret; - } - spin_lock(&crc_list.lock); list_del(&crc->list); spin_unlock(&crc_list.lock); @@ -401,9 +396,9 @@ static int stm32_crc_remove(struct platform_device *pdev) pm_runtime_disable(crc->dev); pm_runtime_put_noidle(crc->dev); - clk_disable_unprepare(crc->clk); - - return 0; + if (ret >= 0) + clk_disable(crc->clk); + clk_unprepare(crc->clk); } static int __maybe_unused stm32_crc_suspend(struct device *dev) @@ -472,7 +467,7 @@ MODULE_DEVICE_TABLE(of, stm32_dt_ids); static struct platform_driver stm32_crc_driver = { .probe = stm32_crc_probe, - .remove = stm32_crc_remove, + .remove_new = stm32_crc_remove, .driver = { .name = DRIVER_NAME, .pm = &stm32_crc_pm_ops, From patchwork Fri Oct 20 07:56:01 2023 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: 13430229 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 C9B51C004C0 for ; Fri, 20 Oct 2023 07:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376535AbjJTH5y (ORCPT ); Fri, 20 Oct 2023 03:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376533AbjJTH5O (ORCPT ); Fri, 20 Oct 2023 03:57:14 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A997C10CF for ; Fri, 20 Oct 2023 00:56:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN7-0003hX-Bo; Fri, 20 Oct 2023 09:56:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN5-002yWQ-Gz; Fri, 20 Oct 2023 09:56:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN5-002OKk-7g; Fri, 20 Oct 2023 09:56:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Maxime Coquelin , Alexandre Torgue , Linus Walleij , nicolas.toromanoff@foss.st.com, Colin Ian King , Rob Herring , linux-crypto@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 39/42] crypto: stm32/cryp - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:56:01 +0200 Message-ID: <20231020075521.2121571-83-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2723; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7A/4jfO5f6HPiPMVJM3k1eEGID7WdOBM8OghW+7z3ug=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKWxBuHKyc8wcbd1mj6AxMptWcoLzYBnaw3U wg+jgwX8VSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIylgAKCRCPgPtYfRL+ ThDwB/wK8d5usctRxniPVmWkOoFU/WfE+6gfYDF2lBAw5FKmcp0+xjRl5hPzamdDONa7wNHQggs vmLCxzAf9nSCzPtI4JlodbrDMzqLrJR2JHHxzh3pqh14ouxm6RsYMgUCK10LH07JW3eOtS3ZYNB MLRUbqq6zG2PI6MN8U4St7jnLxOJZ0Ry/idbzvxTD/Kq539lV98YNQYccHGjZziD5AQzMc9qosN X5tWmf9gRPJaaV2j5UoywSLzRCV3qveCSRxgZUIhdVgM/otC56pBRcSlxeWcyOqGREb7SYQOiKR UO+vpVfxREop/84pttO44tEJO6MF72B7eK4uFbPwzb7EXo9i X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The driver adapted here suffered from this wrong assumption and had several error paths resulting in resource leaks. The check for cryp being non-NULL is harmless. This can never happen as .remove() is only called after .probe() completed successfully and in that case drvdata was set to a non-NULL value. So this check can just be dropped. If pm_runtime_get() fails, the other resources held by the device must still be freed. Only clk_disable_unprepare() should be skipped as the pm_runtime_get() failed to call clk_prepare_enable(). After these changes the remove function returns zero unconditionally and can trivially be converted to the prototype required for .remove_new(). Signed-off-by: Uwe Kleine-König --- drivers/crypto/stm32/stm32-cryp.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/stm32/stm32-cryp.c b/drivers/crypto/stm32/stm32-cryp.c index f095f0065428..c3cbc2673338 100644 --- a/drivers/crypto/stm32/stm32-cryp.c +++ b/drivers/crypto/stm32/stm32-cryp.c @@ -2084,17 +2084,12 @@ static int stm32_cryp_probe(struct platform_device *pdev) return ret; } -static int stm32_cryp_remove(struct platform_device *pdev) +static void stm32_cryp_remove(struct platform_device *pdev) { struct stm32_cryp *cryp = platform_get_drvdata(pdev); int ret; - if (!cryp) - return -ENODEV; - - ret = pm_runtime_resume_and_get(cryp->dev); - if (ret < 0) - return ret; + ret = pm_runtime_get_sync(cryp->dev); if (cryp->caps->aeads_support) crypto_engine_unregister_aeads(aead_algs, ARRAY_SIZE(aead_algs)); @@ -2109,9 +2104,8 @@ static int stm32_cryp_remove(struct platform_device *pdev) pm_runtime_disable(cryp->dev); pm_runtime_put_noidle(cryp->dev); - clk_disable_unprepare(cryp->clk); - - return 0; + if (ret >= 0) + clk_disable_unprepare(cryp->clk); } #ifdef CONFIG_PM @@ -2148,7 +2142,7 @@ static const struct dev_pm_ops stm32_cryp_pm_ops = { static struct platform_driver stm32_cryp_driver = { .probe = stm32_cryp_probe, - .remove = stm32_cryp_remove, + .remove_new = stm32_cryp_remove, .driver = { .name = DRIVER_NAME, .pm = &stm32_cryp_pm_ops, From patchwork Fri Oct 20 07:56:02 2023 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: 13430219 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 C4B88CDB47E for ; Fri, 20 Oct 2023 07:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376514AbjJTH5Y (ORCPT ); Fri, 20 Oct 2023 03:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376511AbjJTH45 (ORCPT ); Fri, 20 Oct 2023 03:56:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A87BC10C1 for ; Fri, 20 Oct 2023 00:56:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN7-0003iY-FY; Fri, 20 Oct 2023 09:56:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN5-002yWT-NK; Fri, 20 Oct 2023 09:56:39 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN5-002OKo-E6; Fri, 20 Oct 2023 09:56:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 40/42] crypto: talitos - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:56:02 +0200 Message-ID: <20231020075521.2121571-84-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1884; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=R/W5Ggr2lsK+y2USJhl+aFdinr2wIRMDyAi6MKUWmjU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKXAedL836rvPh9UPV637nn8dO4yPShep9bx I/sr6xTOi2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIylwAKCRCPgPtYfRL+ TgB/B/973+eh4pE50jmCU9dWenziAGPSvskOHrb3+I1m/olsqMJghDjWMrfKbgRCM63CLu5yDbf LmIeH8v9b94L6nirYBIdcXuYOPTAzK3aQdnfKB+Qxv/alp1k3M2TBOChjhWqibqy5NVYn9/v76M xXpKl8fsFXQGGaxxAJgFg7nvi/bfK+/JRJRGdCtHGDd1E+QkTeCTrgljIILUe3BB17MMPmHYr8l UcFqq8pKghT2cTDfv3cqcmvrjRs3f/U6QxIA6m7HvP4o/am+mf1zXnrWfeSAMVkBdpvTW1HUhVm aTNsNjVJanmBZbLs4iDV9MXdDC6Owhoqu6xL9Ip2cDw+skQO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/crypto/talitos.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 4ca4fbd227bc..e603c0f2abca 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -3136,7 +3136,7 @@ static int hw_supports(struct device *dev, __be32 desc_hdr_template) return ret; } -static int talitos_remove(struct platform_device *ofdev) +static void talitos_remove(struct platform_device *ofdev) { struct device *dev = &ofdev->dev; struct talitos_private *priv = dev_get_drvdata(dev); @@ -3170,8 +3170,6 @@ static int talitos_remove(struct platform_device *ofdev) tasklet_kill(&priv->done_task[0]); if (priv->irq[1]) tasklet_kill(&priv->done_task[1]); - - return 0; } static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev, @@ -3559,7 +3557,7 @@ static struct platform_driver talitos_driver = { .of_match_table = talitos_match, }, .probe = talitos_probe, - .remove = talitos_remove, + .remove_new = talitos_remove, }; module_platform_driver(talitos_driver); From patchwork Fri Oct 20 07:56:03 2023 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: 13430227 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 2A9BDCDB47E for ; Fri, 20 Oct 2023 07:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376532AbjJTH5w (ORCPT ); Fri, 20 Oct 2023 03:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376534AbjJTH5O (ORCPT ); Fri, 20 Oct 2023 03:57:14 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB3110D0 for ; Fri, 20 Oct 2023 00:56:48 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN7-0003jz-P1; Fri, 20 Oct 2023 09:56:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN5-002yWX-Vu; Fri, 20 Oct 2023 09:56:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN5-002OKs-MM; Fri, 20 Oct 2023 09:56:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Michal Simek , Rob Herring , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 41/42] crypto: xilinx/zynqmp-aes-gcm - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:56:03 +0200 Message-ID: <20231020075521.2121571-85-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1840; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0YRy5Ck9WqwgT+T3cQ0SSqnxHXNP9TuQevedBOzuzmo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKZYvpdWKPb0uyCmT5Xuo9ssI948P0gOD91Z BZnMmKTk7qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIymQAKCRCPgPtYfRL+ TlDwB/9zDv8PO7osS/f9v5m4dzkXzb7PW6XopRyyCXRIrh+jsvD9y+COPVzh8Od748qHIChpuyF AyjZMTBDKElLk1R+4jgrkSnEGhFVtWbXtK05/PvBFlM0JVm70AH94Lp/QpOSMw9Ci2Wv079W3TE LAu6ummya13aJqeBDv2Rsij3CHvn3a+GaD6v86ILC0JUY0wgpn4r+eLEJMIZltijnUIoFKApApA 6gaT2Ehd4tRhKB/FHVt9lHSIIBfO0zB7jLMvt749xYmcSq/ZA1bJ32oALQ8mMJuIsWx5AoPuaNg G7FpRz0rS41FzuCmgk/iPrfCwvzEnoETqThNbT68/NjPo1e8 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Simek --- drivers/crypto/xilinx/zynqmp-aes-gcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/xilinx/zynqmp-aes-gcm.c b/drivers/crypto/xilinx/zynqmp-aes-gcm.c index ce335578b759..3c205324b22b 100644 --- a/drivers/crypto/xilinx/zynqmp-aes-gcm.c +++ b/drivers/crypto/xilinx/zynqmp-aes-gcm.c @@ -421,12 +421,10 @@ static int zynqmp_aes_aead_probe(struct platform_device *pdev) return err; } -static int zynqmp_aes_aead_remove(struct platform_device *pdev) +static void zynqmp_aes_aead_remove(struct platform_device *pdev) { crypto_engine_exit(aes_drv_ctx.engine); crypto_engine_unregister_aead(&aes_drv_ctx.alg.aead); - - return 0; } static const struct of_device_id zynqmp_aes_dt_ids[] = { @@ -437,7 +435,7 @@ MODULE_DEVICE_TABLE(of, zynqmp_aes_dt_ids); static struct platform_driver zynqmp_aes_driver = { .probe = zynqmp_aes_aead_probe, - .remove = zynqmp_aes_aead_remove, + .remove_new = zynqmp_aes_aead_remove, .driver = { .name = "zynqmp-aes", .of_match_table = zynqmp_aes_dt_ids, From patchwork Fri Oct 20 07:56:04 2023 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: 13430231 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 E7B46C25B40 for ; Fri, 20 Oct 2023 07:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376486AbjJTH6K (ORCPT ); Fri, 20 Oct 2023 03:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376540AbjJTH5P (ORCPT ); Fri, 20 Oct 2023 03:57:15 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A4E510DD for ; Fri, 20 Oct 2023 00:56:53 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtkN7-0003lJ-Sq; Fri, 20 Oct 2023 09:56:41 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtkN6-002yWc-77; Fri, 20 Oct 2023 09:56:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qtkN5-002OKw-U2; Fri, 20 Oct 2023 09:56:39 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Herbert Xu , "David S. Miller" Cc: Harsha , Michal Simek , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 42/42] crypto: xilinx/zynqmp-sha - Convert to platform remove callback returning void Date: Fri, 20 Oct 2023 09:56:04 +0200 Message-ID: <20231020075521.2121571-86-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> References: <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1813; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=gPYZkWjMK0YxXdO6vFAwk9bH3uOIfVA2GNcUWtwIS9E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlMjKavbyAfJWtCTmFH9OnlFdpVDIp9hZVyUk5i 3oJf7qoxKOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTIymgAKCRCPgPtYfRL+ Tm5RB/sFV9x720XRP/6h3js75u1CIlO68Ioy+hhnxnoB3xldi4/8V4mz2regS7tOz/6f+oNSnju V2DpemkhgJN90/MZWlTVXvnqq9kI+599iq6PdSGyK1Dh5FK9Xzo99j+o8XqrqpuRu7sHfo3wfTt 9Min/B+qO53mHb0i1NbJJOhcauBnNgwnSKKkuRWFvgUKPOzTt89vooadlQWVpD1AApUZukrsgE/ RhRlo5eyhFlIHNvbGuChjTe2uxv7yL7OvyOPcoPu2HrVqcGoL6+KmAEuhIyZpiQdzRDVqFfLhLw 6+P2hwiAp+w/KFAFMbmYh7M6a4ocRG3oy93t4VdusbU7Bzkl X-Developer-Key: i=u.kleine-koenig@pengutronix.de; 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Simek --- drivers/crypto/xilinx/zynqmp-sha.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/xilinx/zynqmp-sha.c b/drivers/crypto/xilinx/zynqmp-sha.c index 426bf1a72ba6..e6c45ceb4bf7 100644 --- a/drivers/crypto/xilinx/zynqmp-sha.c +++ b/drivers/crypto/xilinx/zynqmp-sha.c @@ -238,20 +238,18 @@ static int zynqmp_sha_probe(struct platform_device *pdev) return err; } -static int zynqmp_sha_remove(struct platform_device *pdev) +static void zynqmp_sha_remove(struct platform_device *pdev) { sha3_drv_ctx.dev = platform_get_drvdata(pdev); dma_free_coherent(sha3_drv_ctx.dev, ZYNQMP_DMA_ALLOC_FIXED_SIZE, ubuf, update_dma_addr); dma_free_coherent(sha3_drv_ctx.dev, SHA3_384_DIGEST_SIZE, fbuf, final_dma_addr); crypto_unregister_shash(&sha3_drv_ctx.sha3_384); - - return 0; } static struct platform_driver zynqmp_sha_driver = { .probe = zynqmp_sha_probe, - .remove = zynqmp_sha_remove, + .remove_new = zynqmp_sha_remove, .driver = { .name = "zynqmp-sha3-384", },