linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corentin LABBE <clabbe@baylibre.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Hans Ulli Kroll <ulli.kroll@googlemail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-crypto@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 17/42] crypto: gemini/sl3516-ce - Convert to platform remove callback returning void
Date: Wed, 25 Oct 2023 15:30:41 +0200	[thread overview]
Message-ID: <ZTkYgeOiNvuRgDxE@Red> (raw)
In-Reply-To: <20231020075521.2121571-61-u.kleine-koenig@pengutronix.de>

Le Fri, Oct 20, 2023 at 09:55:39AM +0200, Uwe Kleine-König a écrit :
> 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 <u.kleine-koenig@pengutronix.de>
> ---
>  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,
> -- 
> 2.42.0
> 

Acked-by: Corentin Labbe <clabbe@baylibre.com>

Thanks

  reply	other threads:[~2023-10-25 13:30 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20  7:55 [PATCH 00/42] crypto: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 01/42] crypto: sun4i-ss - " Uwe Kleine-König
2023-10-20 10:10   ` Andre Przywara
2023-10-20 14:08   ` Jernej Škrabec
2023-10-25 13:13   ` Corentin Labbe
2023-10-20  7:55 ` [PATCH 02/42] crypto: sun8i-ce " Uwe Kleine-König
2023-10-20 10:12   ` Andre Przywara
2023-10-20 14:08   ` Jernej Škrabec
2023-10-25 13:14   ` Corentin Labbe
2023-10-20  7:55 ` [PATCH 03/42] crypto: sun8i-ss " Uwe Kleine-König
2023-10-20 10:12   ` Andre Przywara
2023-10-20 14:09   ` Jernej Škrabec
2023-10-25 13:14   ` Corentin Labbe
2023-10-20  7:55 ` [PATCH 04/42] crypto: amcc/crypto4xx " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 05/42] crypto: amlogic-gxl-core " Uwe Kleine-König
2023-10-25 13:30   ` Corentin LABBE
2023-10-20  7:55 ` [PATCH 06/42] crypto: aspeed-acry " Uwe Kleine-König
2023-10-23  2:35   ` Andrew Jeffery
2023-10-20  7:55 ` [PATCH 07/42] crypto: aspeed-hace " Uwe Kleine-König
2023-10-23  2:36   ` Andrew Jeffery
2023-10-20  7:55 ` [PATCH 08/42] crypto: atmel-aes " Uwe Kleine-König
2023-10-20  8:49   ` Hari.PrasathGE
2023-10-20  7:55 ` [PATCH 09/42] crypto: atmel-sha " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 10/42] crypto: atmel-tdes " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 11/42] crypto: axis/artpec6 " Uwe Kleine-König
2023-10-23  7:36   ` Jesper Nilsson
2023-10-20  7:55 ` [PATCH 12/42] crypto: bcm/cipher " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 13/42] crypto: caam/jr " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 14/42] crypto: ccp/sp " Uwe Kleine-König
2023-10-20 18:00   ` Tom Lendacky
2023-10-20  7:55 ` [PATCH 15/42] crypto: ccree/cc " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 16/42] crypto: exynos-rng " Uwe Kleine-König
2023-10-20  8:18   ` Krzysztof Kozlowski
2023-10-24 21:52   ` Andi Shyti
2023-10-20  7:55 ` [PATCH 17/42] crypto: gemini/sl3516-ce " Uwe Kleine-König
2023-10-25 13:30   ` Corentin LABBE [this message]
2023-10-20  7:55 ` [PATCH 18/42] crypto: hisilicon/sec " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 19/42] crypto: hisilicon/trng " Uwe Kleine-König
2023-10-20  9:39   ` Weili Qian
2023-10-20  7:55 ` [PATCH 20/42] crypto: img-hash " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 21/42] crypto: inside-secure/safexcel " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 22/42] crypto: intel/ixp4xx-crypto " Uwe Kleine-König
2023-10-25 13:30   ` Corentin LABBE
2023-10-20  7:55 ` [PATCH 23/42] crypto: intel/keembay-ocs-aes " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 24/42] crypto: intel/keembay-ocs-ecc " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 25/42] crypto: intel/keembay-ocs-hcu " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 26/42] crypto: marvell/cesa " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 27/42] crypto: mxs-dcp " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 28/42] crypto: n2_core " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 29/42] crypto: omap-aes " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 30/42] crypto: omap-des " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 31/42] crypto: omap-sham " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 32/42] crypto: qce " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 33/42] crypto: qcom-rng " Uwe Kleine-König
2023-10-21 17:23   ` Konrad Dybcio
2023-10-20  7:55 ` [PATCH 34/42] crypto: rockchip/rk3288 " Uwe Kleine-König
2023-10-20  8:13   ` Heiko Stübner
2023-10-25 13:31   ` Corentin LABBE
2023-10-20  7:55 ` [PATCH 35/42] crypto: s5p-sss " Uwe Kleine-König
2023-10-20  8:18   ` Krzysztof Kozlowski
2023-10-20  7:55 ` [PATCH 36/42] crypto: sa2ul " Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 37/42] crypto: sahara " Uwe Kleine-König
2023-10-20  7:56 ` [PATCH 38/42] crypto: stm32/crc32 " Uwe Kleine-König
2023-10-20  7:56 ` [PATCH 39/42] crypto: stm32/cryp " Uwe Kleine-König
2023-10-20  7:56 ` [PATCH 40/42] crypto: talitos " Uwe Kleine-König
2023-10-20  7:56 ` [PATCH 41/42] crypto: xilinx/zynqmp-aes-gcm " Uwe Kleine-König
2023-10-20  9:19   ` Michal Simek
2023-10-20  7:56 ` [PATCH 42/42] crypto: xilinx/zynqmp-sha " Uwe Kleine-König
2023-10-20  9:20   ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZTkYgeOiNvuRgDxE@Red \
    --to=clabbe@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=ulli.kroll@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).