]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: fnic: Remove redundant flush_workqueue() calls
authorChen Ni <nichen@iscas.ac.cn>
Wed, 12 Mar 2025 07:43:20 +0000 (15:43 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Mar 2025 01:27:54 +0000 (21:27 -0400)
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>
Link: https://lore.kernel.org/r/20250312074320.1430175-1-nichen@iscas.ac.cn
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fnic/fnic_main.c

index 0b20ac8c3f464b56841ca54e003f0c58039b6d0c..3dd06376e97bc4680a597821f2caef7b33355fd8 100644 (file)
@@ -1365,10 +1365,9 @@ static void __exit fnic_cleanup_module(void)
        if (pc_rscn_handling_feature_flag == PC_RSCN_HANDLING_FEATURE_ON)
                destroy_workqueue(reset_fnic_work_queue);
 
-       if (fnic_fip_queue) {
-               flush_workqueue(fnic_fip_queue);
+       if (fnic_fip_queue)
                destroy_workqueue(fnic_fip_queue);
-       }
+
        kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
        kmem_cache_destroy(fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
        kmem_cache_destroy(fnic_io_req_cache);