* [PATCH 00/42] crypto: Convert to platform remove callback returning void
@ 2023-10-20 7:55 Uwe Kleine-König
2023-10-20 7:55 ` [PATCH 01/42] crypto: sun4i-ss - " Uwe Kleine-König
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-10-20 7:55 UTC (permalink / raw)
To: Herbert Xu, David S. Miller
Cc: Corentin Labbe, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Jonathan Corbet, Rob Herring, linux-crypto, linux-arm-kernel,
linux-sunxi, kernel, Yu Zhe, Corentin Labbe, linux-amlogic,
Neal Liu, Joel Stanley, Andrew Jeffery, linux-aspeed,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Jesper Nilsson,
Lars Persson, linux-arm-kernel, Arnd Bergmann, Horia Geantă,
Pankaj Gupta, Gaurav Jain, Tom Lendacky, John Allen,
Gilad Ben-Yossef, Krzysztof Kozlowski, Alim Akhtar,
linux-samsung-soc, Hans Ulli Kroll, Linus Walleij, Ruan Jinjie,
Weili Qian, Antoine Tenart, Linus Walleij, Imre Kaloz,
Daniele Alessandrelli, Prabhjot Khurana, Mark Gross,
Declan Murphy, Boris Brezillon, Arnaud Ebalard, Srujana Challa,
Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team,
Thara Gopinath, linux-arm-msm, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Heiko Stuebner, linux-rockchip, Vladimir Zapolskiy,
Maxime Coquelin, Alexandre Torgue, linux-stm32,
nicolas.toromanoff, Colin Ian King, Michal Simek, Harsha
Hello,
this series converts all platform drivers below drivers/crypto to use
.remove_new(). Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver
core doesn't (and cannot) cope for errors during remove. The only effect
of a non-zero return value in .remove() is that the driver core emits a
warning. The device is removed anyhow and an early return from .remove()
usually yields resource leaks and/or use-after-free bugs.
There are three drivers that got that wrong and potentially returned an
error code (caam/jr.c, stm32/stm32-crc32.c, stm32/stm32-cryp.c). These
are fixed accordingly. The other drivers could be transformed trivially.
See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.
There are no interdependencies in this series. As there are still quite
a few drivers to convert, I'm happy about every patch that makes it in.
So even if there is a merge conflict with one patch until you apply (or
a different concern that doesn't apply to all patches), please apply the
remainder of this series anyhow. I'll come back to the part that you
(maybe) skipped at a later point.
Best regards and thanks
Uwe
Uwe Kleine-König (42):
crypto: sun4i-ss - Convert to platform remove callback returning void
crypto: sun8i-ce - Convert to platform remove callback returning void
crypto: sun8i-ss - Convert to platform remove callback returning void
crypto: amcc/crypto4xx - Convert to platform remove callback returning void
crypto: amlogic-gxl-core - Convert to platform remove callback returning void
crypto: aspeed-acry - Convert to platform remove callback returning void
crypto: aspeed-hace - Convert to platform remove callback returning void
crypto: atmel-aes - Convert to platform remove callback returning void
crypto: atmel-sha - Convert to platform remove callback returning void
crypto: atmel-tdes - Convert to platform remove callback returning void
crypto: axis/artpec6 - Convert to platform remove callback returning void
crypto: bcm/cipher - Convert to platform remove callback returning void
crypto: caam/jr - Convert to platform remove callback returning void
crypto: ccp/sp - Convert to platform remove callback returning void
crypto: ccree/cc - Convert to platform remove callback returning void
crypto: exynos-rng - Convert to platform remove callback returning void
crypto: gemini/sl3516-ce - Convert to platform remove callback returning void
crypto: hisilicon/sec - Convert to platform remove callback returning void
crypto: hisilicon/trng - Convert to platform remove callback returning void
crypto: img-hash - Convert to platform remove callback returning void
crypto: inside-secure/safexcel - Convert to platform remove callback returning void
crypto: intel/ixp4xx-crypto - Convert to platform remove callback returning void
crypto: intel/keembay-ocs-aes - Convert to platform remove callback returning void
crypto: intel/keembay-ocs-ecc - Convert to platform remove callback returning void
crypto: intel/keembay-ocs-hcu - Convert to platform remove callback returning void
crypto: marvell/cesa - Convert to platform remove callback returning void
crypto: mxs-dcp - Convert to platform remove callback returning void
crypto: n2_core - Convert to platform remove callback returning void
crypto: omap-aes - Convert to platform remove callback returning void
crypto: omap-des - Convert to platform remove callback returning void
crypto: omap-sham - Convert to platform remove callback returning void
crypto: qce - Convert to platform remove callback returning void
crypto: qcom-rng - Convert to platform remove callback returning void
crypto: rockchip/rk3288 - Convert to platform remove callback returning void
crypto: s5p-sss - Convert to platform remove callback returning void
crypto: sa2ul - Convert to platform remove callback returning void
crypto: sahara - Convert to platform remove callback returning void
crypto: stm32/crc32 - Convert to platform remove callback returning void
crypto: stm32/cryp - Convert to platform remove callback returning void
crypto: talitos - Convert to platform remove callback returning void
crypto: xilinx/zynqmp-aes-gcm - Convert to platform remove callback returning void
crypto: xilinx/zynqmp-sha - Convert to platform remove callback returning void
.../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 5 ++---
.../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 ++---
.../crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 6 ++---
drivers/crypto/amcc/crypto4xx_core.c | 6 ++---
drivers/crypto/amlogic/amlogic-gxl-core.c | 5 ++---
drivers/crypto/aspeed/aspeed-acry.c | 6 ++---
drivers/crypto/aspeed/aspeed-hace.c | 6 ++---
drivers/crypto/atmel-aes.c | 6 ++---
drivers/crypto/atmel-sha.c | 6 ++---
drivers/crypto/atmel-tdes.c | 6 ++---
drivers/crypto/axis/artpec6_crypto.c | 5 ++---
drivers/crypto/bcm/cipher.c | 5 ++---
drivers/crypto/caam/jr.c | 22 ++++++++-----------
drivers/crypto/ccp/sp-platform.c | 6 ++---
drivers/crypto/ccree/cc_driver.c | 6 ++---
drivers/crypto/exynos-rng.c | 6 ++---
drivers/crypto/gemini/sl3516-ce-core.c | 6 ++---
drivers/crypto/hisilicon/sec/sec_drv.c | 6 ++---
drivers/crypto/hisilicon/trng/trng.c | 6 ++---
drivers/crypto/img-hash.c | 6 ++---
drivers/crypto/inside-secure/safexcel.c | 6 ++---
drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 6 ++---
.../intel/keembay/keembay-ocs-aes-core.c | 6 ++---
.../crypto/intel/keembay/keembay-ocs-ecc.c | 6 ++---
.../intel/keembay/keembay-ocs-hcu-core.c | 6 ++---
drivers/crypto/marvell/cesa/cesa.c | 6 ++---
drivers/crypto/mxs-dcp.c | 6 ++---
drivers/crypto/n2_core.c | 12 ++++------
drivers/crypto/omap-aes.c | 6 ++---
drivers/crypto/omap-des.c | 6 ++---
drivers/crypto/omap-sham.c | 6 ++---
drivers/crypto/qce/core.c | 5 ++---
drivers/crypto/qcom-rng.c | 6 ++---
drivers/crypto/rockchip/rk3288_crypto.c | 5 ++---
drivers/crypto/s5p-sss.c | 6 ++---
drivers/crypto/sa2ul.c | 6 ++---
drivers/crypto/sahara.c | 6 ++---
drivers/crypto/stm32/stm32-crc32.c | 15 +++++--------
drivers/crypto/stm32/stm32-cryp.c | 16 +++++---------
drivers/crypto/talitos.c | 6 ++---
drivers/crypto/xilinx/zynqmp-aes-gcm.c | 6 ++---
drivers/crypto/xilinx/zynqmp-sha.c | 6 ++---
42 files changed, 99 insertions(+), 187 deletions(-)
base-commit: 4230ea146b1e64628f11e44290bb4008e391bc24
--
2.42.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 01/42] crypto: sun4i-ss - Convert to platform remove callback returning void
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 ` Uwe Kleine-König
2023-10-20 10:10 ` Andre Przywara
` (2 more replies)
2023-10-20 7:55 ` [PATCH 02/42] crypto: sun8i-ce " Uwe Kleine-König
` (2 subsequent siblings)
3 siblings, 3 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-10-20 7:55 UTC (permalink / raw)
To: Herbert Xu, David S. Miller
Cc: Corentin Labbe, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Jonathan Corbet, Rob Herring, linux-crypto, linux-arm-kernel,
linux-sunxi, kernel
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/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,
--
2.42.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 01/42] crypto: sun4i-ss - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Andre Przywara @ 2023-10-20 10:10 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Herbert Xu, David S. Miller, Corentin Labbe, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Jonathan Corbet, Rob Herring,
linux-crypto, linux-arm-kernel, linux-sunxi, kernel
On Fri, 20 Oct 2023 09:55:23 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
Hi,
> 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>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> 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,
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 01/42] crypto: sun4i-ss - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Jernej Škrabec @ 2023-10-20 14:08 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Uwe Kleine-König
Cc: Corentin Labbe, Chen-Yu Tsai, Samuel Holland, Jonathan Corbet,
Rob Herring, linux-crypto, linux-arm-kernel, linux-sunxi, kernel
Dne petek, 20. oktober 2023 ob 09:55:23 CEST je Uwe Kleine-König napisal(a):
> 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>
> ---
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> 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,
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 01/42] crypto: sun4i-ss - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Corentin Labbe @ 2023-10-25 13:13 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Herbert Xu, David S. Miller, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Jonathan Corbet, Rob Herring, linux-crypto,
linux-arm-kernel, linux-sunxi, kernel
Le Fri, Oct 20, 2023 at 09:55:23AM +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/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,
> --
> 2.42.0
>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Thanks
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void
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 7:55 ` Uwe Kleine-König
2023-10-20 10:12 ` Andre Przywara
` (2 more replies)
2023-10-20 7:55 ` [PATCH 03/42] crypto: sun8i-ss " Uwe Kleine-König
2023-10-27 10:53 ` [PATCH 00/42] crypto: " Herbert Xu
3 siblings, 3 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-10-20 7:55 UTC (permalink / raw)
To: Herbert Xu, David S. Miller
Cc: Corentin Labbe, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Rob Herring, Jonathan Corbet, linux-crypto, linux-arm-kernel,
linux-sunxi, kernel
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
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Andre Przywara @ 2023-10-20 10:12 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Herbert Xu, David S. Miller, Corentin Labbe, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Rob Herring, Jonathan Corbet,
linux-crypto, linux-arm-kernel, linux-sunxi, kernel
On Fri, 20 Oct 2023 09:55:24 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
Hi,
> 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>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> 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,
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Jernej Škrabec @ 2023-10-20 14:08 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Uwe Kleine-König
Cc: Corentin Labbe, Chen-Yu Tsai, Samuel Holland, Rob Herring,
Jonathan Corbet, linux-crypto, linux-arm-kernel, linux-sunxi,
kernel
Dne petek, 20. oktober 2023 ob 09:55:24 CEST je Uwe Kleine-König napisal(a):
> 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>
> ---
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> 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,
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 02/42] crypto: sun8i-ce - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Corentin Labbe @ 2023-10-25 13:14 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Herbert Xu, David S. Miller, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Rob Herring, Jonathan Corbet, linux-crypto,
linux-arm-kernel, linux-sunxi, kernel
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 03/42] crypto: sun8i-ss - Convert to platform remove callback returning void
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 7:55 ` [PATCH 02/42] crypto: sun8i-ce " Uwe Kleine-König
@ 2023-10-20 7:55 ` Uwe Kleine-König
2023-10-20 10:12 ` Andre Przywara
` (2 more replies)
2023-10-27 10:53 ` [PATCH 00/42] crypto: " Herbert Xu
3 siblings, 3 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-10-20 7:55 UTC (permalink / raw)
To: Herbert Xu, David S. Miller
Cc: Corentin Labbe, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Jonathan Corbet, Rob Herring, linux-crypto, linux-arm-kernel,
linux-sunxi, kernel
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-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,
--
2.42.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH 03/42] crypto: sun8i-ss - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Andre Przywara @ 2023-10-20 10:12 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Herbert Xu, David S. Miller, Corentin Labbe, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Jonathan Corbet, Rob Herring,
linux-crypto, linux-arm-kernel, linux-sunxi, kernel
On Fri, 20 Oct 2023 09:55:25 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
Hi,
> 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>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> 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,
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 03/42] crypto: sun8i-ss - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Jernej Škrabec @ 2023-10-20 14:09 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Uwe Kleine-König
Cc: Corentin Labbe, Chen-Yu Tsai, Samuel Holland, Jonathan Corbet,
Rob Herring, linux-crypto, linux-arm-kernel, linux-sunxi, kernel
Dne petek, 20. oktober 2023 ob 09:55:25 CEST je Uwe Kleine-König napisal(a):
> 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>
> ---
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> 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,
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 03/42] crypto: sun8i-ss - Convert to platform remove callback returning void
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
2 siblings, 0 replies; 14+ messages in thread
From: Corentin Labbe @ 2023-10-25 13:14 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Herbert Xu, David S. Miller, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Jonathan Corbet, Rob Herring, linux-crypto,
linux-arm-kernel, linux-sunxi, kernel
Le Fri, Oct 20, 2023 at 09:55:25AM +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-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,
> --
> 2.42.0
>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Thanks
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 00/42] crypto: Convert to platform remove callback returning void
2023-10-20 7:55 [PATCH 00/42] crypto: Convert to platform remove callback returning void Uwe Kleine-König
` (2 preceding siblings ...)
2023-10-20 7:55 ` [PATCH 03/42] crypto: sun8i-ss " Uwe Kleine-König
@ 2023-10-27 10:53 ` Herbert Xu
3 siblings, 0 replies; 14+ messages in thread
From: Herbert Xu @ 2023-10-27 10:53 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: David S. Miller, Corentin Labbe, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Jonathan Corbet, Rob Herring, linux-crypto,
linux-arm-kernel, linux-sunxi, kernel, Yu Zhe, Corentin Labbe,
linux-amlogic, Neal Liu, Joel Stanley, Andrew Jeffery,
linux-aspeed, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Jesper Nilsson, Lars Persson, linux-arm-kernel, Arnd Bergmann,
Horia Geantă, Pankaj Gupta, Gaurav Jain, Tom Lendacky,
John Allen, Gilad Ben-Yossef, Krzysztof Kozlowski, Alim Akhtar,
linux-samsung-soc, Hans Ulli Kroll, Linus Walleij, Ruan Jinjie,
Weili Qian, Antoine Tenart, Linus Walleij, Imre Kaloz,
Daniele Alessandrelli, Prabhjot Khurana, Mark Gross,
Declan Murphy, Boris Brezillon, Arnaud Ebalard, Srujana Challa,
Shawn Guo, Sascha Hauer, Fabio Estevam
On Fri, Oct 20, 2023 at 09:55:22AM +0200, Uwe Kleine-König wrote:
> Hello,
>
> this series converts all platform drivers below drivers/crypto to use
> .remove_new(). Compared to the traditional .remove() callback
> .remove_new() returns no value. This is a good thing because the driver
> core doesn't (and cannot) cope for errors during remove. The only effect
> of a non-zero return value in .remove() is that the driver core emits a
> warning. The device is removed anyhow and an early return from .remove()
> usually yields resource leaks and/or use-after-free bugs.
>
> There are three drivers that got that wrong and potentially returned an
> error code (caam/jr.c, stm32/stm32-crc32.c, stm32/stm32-cryp.c). These
> are fixed accordingly. The other drivers could be transformed trivially.
>
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
>
> There are no interdependencies in this series. As there are still quite
> a few drivers to convert, I'm happy about every patch that makes it in.
> So even if there is a merge conflict with one patch until you apply (or
> a different concern that doesn't apply to all patches), please apply the
> remainder of this series anyhow. I'll come back to the part that you
> (maybe) skipped at a later point.
>
> Best regards and thanks
> Uwe
>
> Uwe Kleine-König (42):
> crypto: sun4i-ss - Convert to platform remove callback returning void
> crypto: sun8i-ce - Convert to platform remove callback returning void
> crypto: sun8i-ss - Convert to platform remove callback returning void
> crypto: amcc/crypto4xx - Convert to platform remove callback returning void
> crypto: amlogic-gxl-core - Convert to platform remove callback returning void
> crypto: aspeed-acry - Convert to platform remove callback returning void
> crypto: aspeed-hace - Convert to platform remove callback returning void
> crypto: atmel-aes - Convert to platform remove callback returning void
> crypto: atmel-sha - Convert to platform remove callback returning void
> crypto: atmel-tdes - Convert to platform remove callback returning void
> crypto: axis/artpec6 - Convert to platform remove callback returning void
> crypto: bcm/cipher - Convert to platform remove callback returning void
> crypto: caam/jr - Convert to platform remove callback returning void
> crypto: ccp/sp - Convert to platform remove callback returning void
> crypto: ccree/cc - Convert to platform remove callback returning void
> crypto: exynos-rng - Convert to platform remove callback returning void
> crypto: gemini/sl3516-ce - Convert to platform remove callback returning void
> crypto: hisilicon/sec - Convert to platform remove callback returning void
> crypto: hisilicon/trng - Convert to platform remove callback returning void
> crypto: img-hash - Convert to platform remove callback returning void
> crypto: inside-secure/safexcel - Convert to platform remove callback returning void
> crypto: intel/ixp4xx-crypto - Convert to platform remove callback returning void
> crypto: intel/keembay-ocs-aes - Convert to platform remove callback returning void
> crypto: intel/keembay-ocs-ecc - Convert to platform remove callback returning void
> crypto: intel/keembay-ocs-hcu - Convert to platform remove callback returning void
> crypto: marvell/cesa - Convert to platform remove callback returning void
> crypto: mxs-dcp - Convert to platform remove callback returning void
> crypto: n2_core - Convert to platform remove callback returning void
> crypto: omap-aes - Convert to platform remove callback returning void
> crypto: omap-des - Convert to platform remove callback returning void
> crypto: omap-sham - Convert to platform remove callback returning void
> crypto: qce - Convert to platform remove callback returning void
> crypto: qcom-rng - Convert to platform remove callback returning void
> crypto: rockchip/rk3288 - Convert to platform remove callback returning void
> crypto: s5p-sss - Convert to platform remove callback returning void
> crypto: sa2ul - Convert to platform remove callback returning void
> crypto: sahara - Convert to platform remove callback returning void
> crypto: stm32/crc32 - Convert to platform remove callback returning void
> crypto: stm32/cryp - Convert to platform remove callback returning void
> crypto: talitos - Convert to platform remove callback returning void
> crypto: xilinx/zynqmp-aes-gcm - Convert to platform remove callback returning void
> crypto: xilinx/zynqmp-sha - Convert to platform remove callback returning void
>
> .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 5 ++---
> .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 5 ++---
> .../crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 6 ++---
> drivers/crypto/amcc/crypto4xx_core.c | 6 ++---
> drivers/crypto/amlogic/amlogic-gxl-core.c | 5 ++---
> drivers/crypto/aspeed/aspeed-acry.c | 6 ++---
> drivers/crypto/aspeed/aspeed-hace.c | 6 ++---
> drivers/crypto/atmel-aes.c | 6 ++---
> drivers/crypto/atmel-sha.c | 6 ++---
> drivers/crypto/atmel-tdes.c | 6 ++---
> drivers/crypto/axis/artpec6_crypto.c | 5 ++---
> drivers/crypto/bcm/cipher.c | 5 ++---
> drivers/crypto/caam/jr.c | 22 ++++++++-----------
> drivers/crypto/ccp/sp-platform.c | 6 ++---
> drivers/crypto/ccree/cc_driver.c | 6 ++---
> drivers/crypto/exynos-rng.c | 6 ++---
> drivers/crypto/gemini/sl3516-ce-core.c | 6 ++---
> drivers/crypto/hisilicon/sec/sec_drv.c | 6 ++---
> drivers/crypto/hisilicon/trng/trng.c | 6 ++---
> drivers/crypto/img-hash.c | 6 ++---
> drivers/crypto/inside-secure/safexcel.c | 6 ++---
> drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 6 ++---
> .../intel/keembay/keembay-ocs-aes-core.c | 6 ++---
> .../crypto/intel/keembay/keembay-ocs-ecc.c | 6 ++---
> .../intel/keembay/keembay-ocs-hcu-core.c | 6 ++---
> drivers/crypto/marvell/cesa/cesa.c | 6 ++---
> drivers/crypto/mxs-dcp.c | 6 ++---
> drivers/crypto/n2_core.c | 12 ++++------
> drivers/crypto/omap-aes.c | 6 ++---
> drivers/crypto/omap-des.c | 6 ++---
> drivers/crypto/omap-sham.c | 6 ++---
> drivers/crypto/qce/core.c | 5 ++---
> drivers/crypto/qcom-rng.c | 6 ++---
> drivers/crypto/rockchip/rk3288_crypto.c | 5 ++---
> drivers/crypto/s5p-sss.c | 6 ++---
> drivers/crypto/sa2ul.c | 6 ++---
> drivers/crypto/sahara.c | 6 ++---
> drivers/crypto/stm32/stm32-crc32.c | 15 +++++--------
> drivers/crypto/stm32/stm32-cryp.c | 16 +++++---------
> drivers/crypto/talitos.c | 6 ++---
> drivers/crypto/xilinx/zynqmp-aes-gcm.c | 6 ++---
> drivers/crypto/xilinx/zynqmp-sha.c | 6 ++---
> 42 files changed, 99 insertions(+), 187 deletions(-)
>
> base-commit: 4230ea146b1e64628f11e44290bb4008e391bc24
> --
> 2.42.0
All applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2023-10-27 11:17 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-27 10:53 ` [PATCH 00/42] crypto: " Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox