* [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown()
@ 2024-09-15 10:22 Christophe JAILLET
2024-09-15 10:22 ` [PATCH 2/2] crypto: caam: Slightly simplify platform_device() Christophe JAILLET
2024-10-05 5:31 ` [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown() Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-09-15 10:22 UTC (permalink / raw)
To: Horia Geantă, Pankaj Gupta, Gaurav Jain, Herbert Xu,
David S. Miller, Andrey Smirnov
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-crypto
The type of the last parameter given to devm_add_action_or_reset() is
"struct caam_drv_private *", but in caam_qi_shutdown(), it is casted to
"struct device *".
Pass the correct parameter to devm_add_action_or_reset() so that the
resources are released as expected.
Fixes: f414de2e2fff ("crypto: caam - use devres to de-initialize QI")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is speculative review with care.
---
drivers/crypto/caam/qi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c
index f6111ee9ed34..8ed2bb01a619 100644
--- a/drivers/crypto/caam/qi.c
+++ b/drivers/crypto/caam/qi.c
@@ -794,7 +794,7 @@ int caam_qi_init(struct platform_device *caam_pdev)
caam_debugfs_qi_init(ctrlpriv);
- err = devm_add_action_or_reset(qidev, caam_qi_shutdown, ctrlpriv);
+ err = devm_add_action_or_reset(qidev, caam_qi_shutdown, qidev);
if (err)
goto fail2;
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] crypto: caam: Slightly simplify platform_device()
2024-09-15 10:22 [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown() Christophe JAILLET
@ 2024-09-15 10:22 ` Christophe JAILLET
2024-10-05 5:31 ` [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown() Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-09-15 10:22 UTC (permalink / raw)
To: Horia Geantă, Pankaj Gupta, Gaurav Jain, Herbert Xu,
David S. Miller
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-crypto
'ctrldev' and 'qidev' are the same.
Remove the former to slightly simplify the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This is a follow up to commit 6b175685b4a1 ("crypto: caam/qi - don't
allocate an extra platform device")
---
drivers/crypto/caam/qi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c
index 8ed2bb01a619..7701d00bcb3a 100644
--- a/drivers/crypto/caam/qi.c
+++ b/drivers/crypto/caam/qi.c
@@ -733,7 +733,7 @@ static void free_caam_qi_pcpu_netdev(const cpumask_t *cpus)
int caam_qi_init(struct platform_device *caam_pdev)
{
int err, i;
- struct device *ctrldev = &caam_pdev->dev, *qidev;
+ struct device *qidev = &caam_pdev->dev;
struct caam_drv_private *ctrlpriv;
const cpumask_t *cpus = qman_affine_cpus();
cpumask_var_t clean_mask;
@@ -742,8 +742,7 @@ int caam_qi_init(struct platform_device *caam_pdev)
if (!zalloc_cpumask_var(&clean_mask, GFP_KERNEL))
goto fail_cpumask;
- ctrlpriv = dev_get_drvdata(ctrldev);
- qidev = ctrldev;
+ ctrlpriv = dev_get_drvdata(qidev);
/* Initialize the congestion detection */
err = init_cgr(qidev);
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown()
2024-09-15 10:22 [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown() Christophe JAILLET
2024-09-15 10:22 ` [PATCH 2/2] crypto: caam: Slightly simplify platform_device() Christophe JAILLET
@ 2024-10-05 5:31 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2024-10-05 5:31 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Horia Geantă, Pankaj Gupta, Gaurav Jain, David S. Miller,
Andrey Smirnov, linux-kernel, kernel-janitors, linux-crypto
On Sun, Sep 15, 2024 at 12:22:12PM +0200, Christophe JAILLET wrote:
> The type of the last parameter given to devm_add_action_or_reset() is
> "struct caam_drv_private *", but in caam_qi_shutdown(), it is casted to
> "struct device *".
>
> Pass the correct parameter to devm_add_action_or_reset() so that the
> resources are released as expected.
>
> Fixes: f414de2e2fff ("crypto: caam - use devres to de-initialize QI")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch is speculative review with care.
> ---
> drivers/crypto/caam/qi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
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] 3+ messages in thread
end of thread, other threads:[~2024-10-05 5:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-15 10:22 [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown() Christophe JAILLET
2024-09-15 10:22 ` [PATCH 2/2] crypto: caam: Slightly simplify platform_device() Christophe JAILLET
2024-10-05 5:31 ` [PATCH 1/2] crypto: caam: Fix the pointer passed to caam_qi_shutdown() Herbert Xu
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).