2023-03-14 18:23:54

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH] crypto: keembay-ocs-aes: Drop if with an always false condition

A platform device's remove callback is only ever called after the probe
callback returned success.

In the case of kmb_ocs_aes_remove() this means that kmb_ocs_aes_probe()
succeeded before and so platform_set_drvdata() was called with a
non-zero argument and platform_get_drvdata() returns non-NULL.

This prepares making remove callbacks return void.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/crypto/keembay/keembay-ocs-aes-core.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/crypto/keembay/keembay-ocs-aes-core.c b/drivers/crypto/keembay/keembay-ocs-aes-core.c
index 9953f5590ac4..ae31be00357a 100644
--- a/drivers/crypto/keembay/keembay-ocs-aes-core.c
+++ b/drivers/crypto/keembay/keembay-ocs-aes-core.c
@@ -1580,8 +1580,6 @@ static int kmb_ocs_aes_remove(struct platform_device *pdev)
struct ocs_aes_dev *aes_dev;

aes_dev = platform_get_drvdata(pdev);
- if (!aes_dev)
- return -ENODEV;

unregister_aes_algs(aes_dev);

--
2.39.2



2023-03-24 10:32:31

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: keembay-ocs-aes: Drop if with an always false condition

On Tue, Mar 14, 2023 at 07:23:38PM +0100, Uwe Kleine-K?nig wrote:
> A platform device's remove callback is only ever called after the probe
> callback returned success.
>
> In the case of kmb_ocs_aes_remove() this means that kmb_ocs_aes_probe()
> succeeded before and so platform_set_drvdata() was called with a
> non-zero argument and platform_get_drvdata() returns non-NULL.
>
> This prepares making remove callbacks return void.
>
> Signed-off-by: Uwe Kleine-K?nig <[email protected]>
> ---
> drivers/crypto/keembay/keembay-ocs-aes-core.c | 2 --
> 1 file changed, 2 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt