diff mbox series

qedi: Remove redundant 'flush_workqueue()' calls

Message ID 20220127013934.1184923-1-chi.minghao@zte.com.cn (mailing list archive)
State Accepted
Headers show
Series qedi: Remove redundant 'flush_workqueue()' calls | expand

Commit Message

CGEL Jan. 27, 2022, 1:39 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/scsi/qedi/qedi_main.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Manish Rangankar Feb. 7, 2022, 4:47 a.m. UTC | #1
> -----Original Message-----
> From: cgel.zte@gmail.com <cgel.zte@gmail.com>
> Sent: Thursday, January 27, 2022 7:10 AM
> To: Nilesh Javali <njavali@marvell.com>
> Cc: Manish Rangankar <mrangankar@marvell.com>; GR-QLogic-Storage-
> Upstream <GR-QLogic-Storage-Upstream@marvell.com>; jejb@linux.ibm.com;
> martin.petersen@oracle.com; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org; Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>;
> Zeal Robot <zealci@zte.com.cn>; CGEL ZTE <cgel.zte@gmail.com>
> Subject: [EXT] [PATCH] qedi: Remove redundant 'flush_workqueue()' calls
> 
> External Email
> 
> ----------------------------------------------------------------------
> 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/scsi/qedi/qedi_main.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index
> 832a856dd367..83ffba7f51da 100644
> --- a/drivers/scsi/qedi/qedi_main.c
> +++ b/drivers/scsi/qedi/qedi_main.c
> @@ -2418,13 +2418,11 @@ static void __qedi_remove(struct pci_dev *pdev,
> int mode)
>  		iscsi_host_remove(qedi->shost);
> 
>  		if (qedi->tmf_thread) {
> -			flush_workqueue(qedi->tmf_thread);
>  			destroy_workqueue(qedi->tmf_thread);
>  			qedi->tmf_thread = NULL;
>  		}
> 
>  		if (qedi->offload_thread) {
> -			flush_workqueue(qedi->offload_thread);
>  			destroy_workqueue(qedi->offload_thread);
>  			qedi->offload_thread = NULL;
>  		}

Thanks,

Acked-by: Manish Rangankar <mrangankar@marvell.com>
Martin K. Petersen Feb. 8, 2022, 4:52 a.m. UTC | #2
On Thu, 27 Jan 2022 01:39:34 +0000, cgel.zte@gmail.com wrote:

> 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.
> 
> [...]

Applied to 5.18/scsi-queue, thanks!

[1/1] qedi: Remove redundant 'flush_workqueue()' calls
      https://git.kernel.org/mkp/scsi/c/0603be719237
diff mbox series

Patch

diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index 832a856dd367..83ffba7f51da 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -2418,13 +2418,11 @@  static void __qedi_remove(struct pci_dev *pdev, int mode)
 		iscsi_host_remove(qedi->shost);
 
 		if (qedi->tmf_thread) {
-			flush_workqueue(qedi->tmf_thread);
 			destroy_workqueue(qedi->tmf_thread);
 			qedi->tmf_thread = NULL;
 		}
 
 		if (qedi->offload_thread) {
-			flush_workqueue(qedi->offload_thread);
 			destroy_workqueue(qedi->offload_thread);
 			qedi->offload_thread = NULL;
 		}