[PATCH net-next] octeontx2-af: mcs: Remove redundant 'flush_workqueue()' calls

Chen Ni posted 1 patch 8 months, 3 weeks ago
drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 1 -
1 file changed, 1 deletion(-)
[PATCH net-next] octeontx2-af: mcs: Remove redundant 'flush_workqueue()' calls
Posted by Chen Ni 8 months, 3 weeks ago
'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: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
index d39d86e694cc..655dd4726d36 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c
@@ -925,7 +925,6 @@ void rvu_mcs_exit(struct rvu *rvu)
 	if (!rvu->mcs_intr_wq)
 		return;
 
-	flush_workqueue(rvu->mcs_intr_wq);
 	destroy_workqueue(rvu->mcs_intr_wq);
 	rvu->mcs_intr_wq = NULL;
 }
-- 
2.25.1
Re: [PATCH net-next] octeontx2-af: mcs: Remove redundant 'flush_workqueue()' calls
Posted by Simon Horman 8 months, 3 weeks ago
On Mon, Mar 24, 2025 at 04:08:54PM +0800, Chen Ni 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: Chen Ni <nichen@iscas.ac.cn>

Reviewed-by: Simon Horman <horms@kernel.org>