2021-11-12 16:49:33

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH] crypto: ccree - remove redundant 'flush_workqueue()' calls

'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

This was generated with coccinelle:

@@
expression E;
@@
- flush_workqueue(E);
destroy_workqueue(E);

Signed-off-by: Christophe JAILLET <[email protected]>
---
drivers/crypto/ccree/cc_request_mgr.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
index 33fb27745d52..887162df50f9 100644
--- a/drivers/crypto/ccree/cc_request_mgr.c
+++ b/drivers/crypto/ccree/cc_request_mgr.c
@@ -101,7 +101,6 @@ void cc_req_mgr_fini(struct cc_drvdata *drvdata)
dev_dbg(dev, "max_used_sw_slots=%d\n", req_mgr_h->max_used_sw_slots);

#ifdef COMP_IN_WQ
- flush_workqueue(req_mgr_h->workq);
destroy_workqueue(req_mgr_h->workq);
#else
/* Kill tasklet */
--
2.30.2



2021-11-12 18:18:55

by Cristian Marussi

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccree - remove redundant 'flush_workqueue()' calls

On Fri, Nov 12, 2021 at 05:49:23PM +0100, Christophe JAILLET wrote:
> 'destroy_workqueue()' already drains the queue before destroying it, so
> there is no need to flush it explicitly.
>
> Remove the redundant 'flush_workqueue()' calls.
>
> This was generated with coccinelle:

Hi Cristophe,

>
> @@
> expression E;
> @@
> - flush_workqueue(E);
> destroy_workqueue(E);
>
> Signed-off-by: Christophe JAILLET <[email protected]>

LGTM.

Reviewed-by: Cristian Marussi <[email protected]>

Thanks,
Cristian

> ---
> drivers/crypto/ccree/cc_request_mgr.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
> index 33fb27745d52..887162df50f9 100644
> --- a/drivers/crypto/ccree/cc_request_mgr.c
> +++ b/drivers/crypto/ccree/cc_request_mgr.c
> @@ -101,7 +101,6 @@ void cc_req_mgr_fini(struct cc_drvdata *drvdata)
> dev_dbg(dev, "max_used_sw_slots=%d\n", req_mgr_h->max_used_sw_slots);
>
> #ifdef COMP_IN_WQ
> - flush_workqueue(req_mgr_h->workq);
> destroy_workqueue(req_mgr_h->workq);
> #else
> /* Kill tasklet */
> --
> 2.30.2
>

2021-11-16 07:42:31

by Gilad Ben-Yossef

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccree - remove redundant 'flush_workqueue()' calls

On Fri, Nov 12, 2021 at 6:49 PM Christophe JAILLET
<[email protected]> wrote:
>
> 'destroy_workqueue()' already drains the queue before destroying it, so
> there is no need to flush it explicitly.
>
> Remove the redundant 'flush_workqueue()' calls.
>
> This was generated with coccinelle:
>
> @@
> expression E;
> @@
> - flush_workqueue(E);
> destroy_workqueue(E);
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> drivers/crypto/ccree/cc_request_mgr.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
> index 33fb27745d52..887162df50f9 100644
> --- a/drivers/crypto/ccree/cc_request_mgr.c
> +++ b/drivers/crypto/ccree/cc_request_mgr.c
> @@ -101,7 +101,6 @@ void cc_req_mgr_fini(struct cc_drvdata *drvdata)
> dev_dbg(dev, "max_used_sw_slots=%d\n", req_mgr_h->max_used_sw_slots);
>
> #ifdef COMP_IN_WQ
> - flush_workqueue(req_mgr_h->workq);
> destroy_workqueue(req_mgr_h->workq);
> #else
> /* Kill tasklet */
> --
> 2.30.2
>

Acked-by: Gilad Ben-Yossef <[email protected]>

Thank you for finding ths.

Also, this triggers me to revisit why the workqueue code is there at
all. I think we don't actually use it, so double thanks.

Gilad

--
Gilad Ben-Yossef
Chief Coffee Drinker

values of β will give rise to dom!

2021-11-20 04:32:56

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccree - remove redundant 'flush_workqueue()' calls

On Fri, Nov 12, 2021 at 05:49:23PM +0100, Christophe JAILLET wrote:
> 'destroy_workqueue()' already drains the queue before destroying it, so
> there is no need to flush it explicitly.
>
> Remove the redundant 'flush_workqueue()' calls.
>
> This was generated with coccinelle:
>
> @@
> expression E;
> @@
> - flush_workqueue(E);
> destroy_workqueue(E);
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> drivers/crypto/ccree/cc_request_mgr.c | 1 -
> 1 file changed, 1 deletion(-)

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