From: Corentin Labbe <clabbe.montjoie@gmail.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>,
Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Rob Herring <robh@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, kernel@pengutronix.de
Subject: Re: [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void
Date: Wed, 25 Oct 2023 15:14:33 +0200 [thread overview]
Message-ID: <ZTkUuQ4cu-Z593_f@Red> (raw)
In-Reply-To: <20231020075521.2121571-46-u.kleine-koenig@pengutronix.de>
Le Fri, Oct 20, 2023 at 09:55:24AM +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/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,
> --
> 2.42.0
>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Thanks
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-10-25 13:15 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231020075521.2121571-44-u.kleine-koenig@pengutronix.de>
2023-10-20 7:55 ` [PATCH 01/42] crypto: sun4i-ss - Convert to platform remove callback returning void 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 [this message]
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 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 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
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 27/42] crypto: mxs-dcp " Uwe Kleine-König
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: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 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=ZTkUuQ4cu-Z593_f@Red \
--to=clabbe.montjoie@gmail.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jernej.skrabec@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wens@csie.org \
/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).