All of lore.kernel.org
 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>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH 34/42] crypto: rockchip/rk3288 - Convert to platform remove callback returning void
Date: Wed, 25 Oct 2023 15:31:09 +0200	[thread overview]
Message-ID: <ZTkYnTY7VxIaIUak@Red> (raw)
In-Reply-To: <20231020075521.2121571-78-u.kleine-koenig@pengutronix.de>

Le Fri, Oct 20, 2023 at 09:55:56AM +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/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,
> -- 
> 2.42.0
> 

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

Thanks

WARNING: multiple messages have this Message-ID (diff)
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>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH 34/42] crypto: rockchip/rk3288 - Convert to platform remove callback returning void
Date: Wed, 25 Oct 2023 15:31:09 +0200	[thread overview]
Message-ID: <ZTkYnTY7VxIaIUak@Red> (raw)
In-Reply-To: <20231020075521.2121571-78-u.kleine-koenig@pengutronix.de>

Le Fri, Oct 20, 2023 at 09:55:56AM +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/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,
> -- 
> 2.42.0
> 

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

Thanks

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
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>,
	Heiko Stuebner <heiko@sntech.de>,
	linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH 34/42] crypto: rockchip/rk3288 - Convert to platform remove callback returning void
Date: Wed, 25 Oct 2023 15:31:09 +0200	[thread overview]
Message-ID: <ZTkYnTY7VxIaIUak@Red> (raw)
In-Reply-To: <20231020075521.2121571-78-u.kleine-koenig@pengutronix.de>

Le Fri, Oct 20, 2023 at 09:55:56AM +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/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,
> -- 
> 2.42.0
> 

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

Thanks

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

Thread overview: 120+ 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 ` Uwe Kleine-König
2023-10-20  7:55 ` Uwe Kleine-König
2023-10-20  7:55 ` 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:10   ` Andre Przywara
2023-10-20 10:10     ` Andre Przywara
2023-10-20 14:08   ` Jernej Škrabec
2023-10-20 14:08     ` Jernej Škrabec
2023-10-25 13:13   ` Corentin Labbe
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  7:55   ` Uwe Kleine-König
2023-10-20 10:12   ` Andre Przywara
2023-10-20 10:12     ` Andre Przywara
2023-10-20 14:08   ` Jernej Škrabec
2023-10-20 14:08     ` Jernej Škrabec
2023-10-25 13:14   ` Corentin Labbe
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  7:55   ` Uwe Kleine-König
2023-10-20 10:12   ` Andre Przywara
2023-10-20 10:12     ` Andre Przywara
2023-10-20 14:09   ` Jernej Škrabec
2023-10-20 14:09     ` Jernej Škrabec
2023-10-25 13:14   ` Corentin Labbe
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-20  7:55   ` Uwe Kleine-König
2023-10-25 13:30   ` Corentin LABBE
2023-10-25 13:30     ` Corentin LABBE
2023-10-20  7:55 ` [PATCH 06/42] crypto: aspeed-acry " Uwe Kleine-König
2023-10-20  7:55   ` Uwe Kleine-König
2023-10-20  7:55   ` Uwe Kleine-König
2023-10-23  2:35   ` Andrew Jeffery
2023-10-23  2:35     ` Andrew Jeffery
2023-10-23  2:35     ` Andrew Jeffery
2023-10-20  7:55 ` [PATCH 07/42] crypto: aspeed-hace " Uwe Kleine-König
2023-10-20  7:55   ` Uwe Kleine-König
2023-10-20  7:55   ` Uwe Kleine-König
2023-10-23  2:36   ` Andrew Jeffery
2023-10-23  2:36     ` Andrew Jeffery
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  7:55   ` Uwe Kleine-König
2023-10-20  8:49   ` Hari.PrasathGE
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   ` Uwe Kleine-König
2023-10-20  7:55 ` [PATCH 10/42] crypto: atmel-tdes " Uwe Kleine-König
2023-10-20  7:55   ` 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  7:55   ` Uwe Kleine-König
2023-10-20  8:18   ` Krzysztof Kozlowski
2023-10-20  8:18     ` Krzysztof Kozlowski
2023-10-24 21:52   ` Andi Shyti
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-20  7:55   ` Uwe Kleine-König
2023-10-25 13:30   ` Corentin LABBE
2023-10-25 13:30     ` Corentin LABBE
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-20  7:55   ` Uwe Kleine-König
2023-10-25 13:30   ` Corentin LABBE
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   ` 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  7:55   ` Uwe Kleine-König
2023-10-20  7:55   ` Uwe Kleine-König
2023-10-20  8:13   ` Heiko Stübner
2023-10-20  8:13     ` Heiko Stübner
2023-10-20  8:13     ` Heiko Stübner
2023-10-25 13:31   ` Corentin LABBE [this message]
2023-10-25 13:31     ` Corentin LABBE
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   ` Uwe Kleine-König
2023-10-20  7:56 ` [PATCH 39/42] crypto: stm32/cryp " Uwe Kleine-König
2023-10-20  7:56   ` 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  7:56   ` Uwe Kleine-König
2023-10-20  9:19   ` Michal Simek
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  7:56   ` Uwe Kleine-König
2023-10-20  9:20   ` Michal Simek
2023-10-20  9:20     ` Michal Simek
2023-10-27 10:53 ` [PATCH 00/42] crypto: " Herbert Xu
2023-10-27 10:53   ` Herbert Xu

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=ZTkYnTY7VxIaIUak@Red \
    --to=clabbe@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=heiko@sntech.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.