[PATCH] Input: cs40l50 - Remove redundant 'flush_workqueue()' calls

Chen Ni posted 1 patch 9 months, 1 week ago
drivers/input/misc/cs40l50-vibra.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] Input: cs40l50 - Remove redundant 'flush_workqueue()' calls
Posted by Chen Ni 9 months, 1 week 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/input/misc/cs40l50-vibra.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/misc/cs40l50-vibra.c b/drivers/input/misc/cs40l50-vibra.c
index dce3b0ec8cf3..0fc7ab032cf5 100644
--- a/drivers/input/misc/cs40l50-vibra.c
+++ b/drivers/input/misc/cs40l50-vibra.c
@@ -480,7 +480,6 @@ static int cs40l50_erase(struct input_dev *dev, int effect_id)
 
 static void cs40l50_remove_wq(void *data)
 {
-	flush_workqueue(data);
 	destroy_workqueue(data);
 }
 
-- 
2.25.1
Re: [PATCH] Input: cs40l50 - Remove redundant 'flush_workqueue()' calls
Posted by Dmitry Torokhov 5 months, 2 weeks ago
On Wed, Mar 12, 2025 at 03:29:40PM +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>

Applied, thank you.

-- 
Dmitry