diff mbox series

vchiq-mmal: Remove redundant 'flush_workqueue()' calls

Message ID 20220127014432.1185206-1-chi.minghao@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series vchiq-mmal: Remove redundant 'flush_workqueue()' calls | expand

Commit Message

CGEL Jan. 27, 2022, 1:44 a.m. UTC
From: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>

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

Remove the redundant 'flush_workqueue()' calls.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
---
 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Stefan Wahren Jan. 27, 2022, 12:35 p.m. UTC | #1
Hi,

Am 27.01.22 um 02:44 schrieb cgel.zte@gmail.com:
> From: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>
>
> 'destroy_workqueue()' already drains the queue before destroying it,
> so there is no need to flush it explicitly.
>
> Remove the redundant 'flush_workqueue()' calls.
are you sure that drain_workqueue() is the same as flush_workqueue()?
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
> ---
>  drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> index 76d3f0399964..60305c63c6f6 100644
> --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
> @@ -1844,7 +1844,6 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
>  	mutex_unlock(&instance->vchiq_mutex);
>  
>  	vchiq_shutdown(instance->vchiq_instance);
> -	flush_workqueue(instance->bulk_wq);
>  	destroy_workqueue(instance->bulk_wq);
>  
>  	vfree(instance->bulk_scratch);
Dan Carpenter Jan. 28, 2022, 7:03 a.m. UTC | #2
On Thu, Jan 27, 2022 at 01:35:09PM +0100, Stefan Wahren wrote:
> Hi,
> 
> Am 27.01.22 um 02:44 schrieb cgel.zte@gmail.com:
> > From: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>
> >
> > 'destroy_workqueue()' already drains the queue before destroying it,
> > so there is no need to flush it explicitly.
> >
> > Remove the redundant 'flush_workqueue()' calls.
> are you sure that drain_workqueue() is the same as flush_workqueue()?

drain_workqueue() calls flush_workqueue() repeatedly.

regards,
dan carpenter
Stefan Wahren Jan. 28, 2022, 11:51 a.m. UTC | #3
Am 28.01.22 um 08:03 schrieb Dan Carpenter:
> On Thu, Jan 27, 2022 at 01:35:09PM +0100, Stefan Wahren wrote:
>> Hi,
>>
>> Am 27.01.22 um 02:44 schrieb cgel.zte@gmail.com:
>>> From: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>
>>>
>>> 'destroy_workqueue()' already drains the queue before destroying it,
>>> so there is no need to flush it explicitly.
>>>
>>> Remove the redundant 'flush_workqueue()' calls.
>> are you sure that drain_workqueue() is the same as flush_workqueue()?
> drain_workqueue() calls flush_workqueue() repeatedly.

sorry, i overlooked this

I'm fine with the patch

>
> regards,
> dan carpenter
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox series

Patch

diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
index 76d3f0399964..60305c63c6f6 100644
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1844,7 +1844,6 @@  int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
 	mutex_unlock(&instance->vchiq_mutex);
 
 	vchiq_shutdown(instance->vchiq_instance);
-	flush_workqueue(instance->bulk_wq);
 	destroy_workqueue(instance->bulk_wq);
 
 	vfree(instance->bulk_scratch);