[PATCH] drm/bridge: anx7625: Remove redundant 'flush_workqueue()' calls

Chen Ni posted 1 patch 9 months, 1 week ago
drivers/gpu/drm/bridge/analogix/anx7625.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] drm/bridge: anx7625: 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/gpu/drm/bridge/analogix/anx7625.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 0b97b66de577..591ec8e5b642 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -2771,7 +2771,6 @@ static void anx7625_i2c_remove(struct i2c_client *client)
 
 	if (platform->hdcp_workqueue) {
 		cancel_delayed_work(&platform->hdcp_work);
-		flush_workqueue(platform->hdcp_workqueue);
 		destroy_workqueue(platform->hdcp_workqueue);
 	}
 
-- 
2.25.1
Re: [PATCH] drm/bridge: anx7625: Remove redundant 'flush_workqueue()' calls
Posted by Doug Anderson 8 months, 3 weeks ago
Hi,

On Wed, Mar 12, 2025 at 2:02 AM Chen Ni <nichen@iscas.ac.cn> 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>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 1 -
>  1 file changed, 1 deletion(-)

I guess nobody else is going to land this, so I went ahead and did it.
;-) Pushed to drm-misc-next:

[1/1] drm/bridge: anx7625: Remove redundant 'flush_workqueue()' calls
      commit: c1031442d384eea6d53a1d1ec6791a2782afcdbc
Re: [PATCH] drm/bridge: anx7625: Remove redundant 'flush_workqueue()' calls
Posted by Doug Anderson 9 months, 1 week ago
Hi,

On Wed, Mar 12, 2025 at 2:02 AM Chen Ni <nichen@iscas.ac.cn> 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>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Re: [PATCH] drm/bridge: anx7625: Remove redundant 'flush_workqueue()' calls
Posted by Robert Foss 9 months, 1 week ago
On Wed, Mar 12, 2025 at 10:02 AM Chen Ni <nichen@iscas.ac.cn> 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>
> ---
>  drivers/gpu/drm/bridge/analogix/anx7625.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 0b97b66de577..591ec8e5b642 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -2771,7 +2771,6 @@ static void anx7625_i2c_remove(struct i2c_client *client)
>
>         if (platform->hdcp_workqueue) {
>                 cancel_delayed_work(&platform->hdcp_work);
> -               flush_workqueue(platform->hdcp_workqueue);
>                 destroy_workqueue(platform->hdcp_workqueue);
>         }

Reviewed-by: Robert Foss <rfoss@kernel.org>

>
> --
> 2.25.1
>