From patchwork Thu Aug 22 19:59:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822106 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E03011D12E6 for ; Thu, 22 Aug 2024 20:01:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356916; cv=none; b=NZcbcisz5U7YONWdH82XHWK68rrVQjR5DrSBuTglPW0wAqZ2gC/MpgxNYI6eo/kXYpvIX/CTJ3aa4ReNX4Vrhs7Ps4KVZ9QOKWOKXh0W6pGobdBVnbsmPCpJ6GGfeOnnjyNo8CiPtsgA+NOp449VulHsRvLkWDyEFqfykA14ZDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356916; c=relaxed/simple; bh=ATyMHTFR2N3O/TdXge7TDZCvZasUJcFUiR1WzB28Z9I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CNLHGKjbl8I1Hcaz1I3s+cSpsLaee4KaQ43t7KkS9q0I2uG4gzSlPFW5kaEzzsI6C5bbQmp/mMfedUKr9LymbB4smci7Y5eTgO8LcZRuxNjtqfYKc0+mqZ+NAxGpABnJYT1YZ8+7/yY4tQfAOzFI0eFOwSJ5sf92/b6+N1xWA1M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=EBynBucB; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="EBynBucB" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYxt28KYz6ClY9K; Thu, 22 Aug 2024 20:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356811; x=1726948812; bh=t6+mT XgSJArZjtGyRRwduSZx2pgF7+ybbuplsedCg4c=; b=EBynBucBAValQL0sln56Z TZEH4HL7gcvtWZ6SuqmkPpxR6O9zGfmd4AWdDHI+SoBCWq4R1NjAdoWZiKPwY7F5 RPQlC/jffXfCa4NihONMLwQ5EpHMaIkl6BVznRFV7is4qWZ6JH+WSY8ljT2AhvZ0 SIFW1aH2m2VBL4w3PlzBM2bvEkzMUjp7df+R0FG6BXvIvkwnIUK9ZEVY09G6vsgp aXhORcOk9HEUbbfbsFmdHFzSHUp8ZQE/nCLBJJVQtN76OEJuZqSZMWs9BTnPdpuT J2WvQO9VNxFy4dp7npJr/KKGIGVroDjC+//sNBFXLQu/x9PEzN1gbIzMBPyguUeF w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id kG8750Hr_rBW; Thu, 22 Aug 2024 20:00:11 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYvq1Lwcz6ClY9J; Thu, 22 Aug 2024 20:00:07 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Peter Wang , Anil Gurumurthy , Sudarsana Kalluru , "James E.J. Bottomley" , Saurav Kashyap , Javed Hasan , GR-QLogic-Storage-Upstream@marvell.com, James Smart , Ram Vegesna , Bradley Grove , Hannes Reinecke , Satish Kharat , Sesidhar Baddela , Karan Tilak Kumar , Xiang Chen , Tyrel Datwyler , Kashyap Desai , Sumit Saxena , Shivasharan S , Chandrakanth patil , Sathya Prakash Veerichetty , Sreekanth Reddy , Suganath Prabu Subramani , Nilesh Javali , Manish Rangankar , Vishal Bhakta , Matthias Brugger , AngeloGioacchino Del Regno , Nathan Chancellor , Mike Christie , Martin Wilck , Johannes Thumshirn , Damien Le Moal , John Garry , Manivannan Sadhasivam , Avri Altman , Andrew Halaney , Bean Huo Subject: [PATCH v3 01/18] scsi: Expand all create*_workqueue() invocations Date: Thu, 22 Aug 2024 12:59:05 -0700 Message-ID: <20240822195944.654691-2-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The workqueue maintainer wants to remove the create*_workqueue() macros because these macros always set the WQ_MEM_RECLAIM flag and because these only support literal workqueue names. Hence this patch that replaces the create*_workqueue() invocations with the definition of this macro. The WQ_MEM_RECLAIM flag has been retained because I think that flag is necessary for workqueues created by storage drivers. This patch has been generated by running spatch and git clang-format. spatch has been invoked as follows: spatch --in-place --sp-file expand-create-workqueue.spatch $(git grep -lEw 'create_(freezable_|singlethread_|)workqueue' */scsi */ufs) The contents of the expand-create-workqueue.spatch file is as follows: @@ expression name; @@ -create_workqueue(name) +alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, name) @@ expression name; @@ -create_freezable_workqueue(name) +alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1, name) @@ expression name; @@ -create_singlethread_workqueue(name) +alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name) Reviewed-by: Peter Wang Signed-off-by: Bart Van Assche --- drivers/scsi/bfa/bfad_im.c | 3 ++- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 4 ++-- drivers/scsi/device_handler/scsi_dh_rdac.c | 3 ++- drivers/scsi/elx/efct/efct_lio.c | 3 ++- drivers/scsi/esas2r/esas2r_init.c | 3 ++- drivers/scsi/fcoe/fcoe_sysfs.c | 8 ++++---- drivers/scsi/fnic/fnic_main.c | 6 ++++-- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 ++- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +- drivers/scsi/libfc/fc_exch.c | 3 ++- drivers/scsi/libfc/fc_rport.c | 3 ++- drivers/scsi/libsas/sas_init.c | 4 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 ++-- drivers/scsi/mpi3mr/mpi3mr_fw.c | 4 ++-- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++-- drivers/scsi/myrb.c | 3 ++- drivers/scsi/myrs.c | 3 ++- drivers/scsi/qedf/qedf_main.c | 13 +++++++------ drivers/scsi/qedi/qedi_main.c | 6 ++++-- drivers/scsi/qla2xxx/qla_os.c | 6 ++++-- drivers/scsi/qla4xxx/ql4_os.c | 2 +- drivers/scsi/snic/snic_main.c | 6 ++++-- drivers/scsi/stex.c | 3 ++- drivers/scsi/vmw_pvscsi.c | 3 ++- drivers/ufs/core/ufshcd.c | 5 +++-- 25 files changed, 64 insertions(+), 43 deletions(-) diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index a9d3d8562d3c..a1d015356063 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -768,7 +768,8 @@ bfad_thread_workq(struct bfad_s *bfad) bfa_trc(bfad, 0); snprintf(im->drv_workq_name, KOBJ_NAME_LEN, "bfad_wq_%d", bfad->inst_no); - im->drv_workq = create_singlethread_workqueue(im->drv_workq_name); + im->drv_workq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + im->drv_workq_name); if (!im->drv_workq) return BFA_STATUS_FAILED; diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 1078c20c5ef6..f49783b89d04 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -2363,8 +2363,8 @@ static int _bnx2fc_create(struct net_device *netdev, interface->vlan_id = vlan_id; interface->tm_timeout = BNX2FC_TM_TIMEOUT; - interface->timer_work_queue = - create_singlethread_workqueue("bnx2fc_timer_wq"); + interface->timer_work_queue = alloc_ordered_workqueue( + "%s", WQ_MEM_RECLAIM, "bnx2fc_timer_wq"); if (!interface->timer_work_queue) { printk(KERN_ERR PFX "ulp_init could not create timer_wq\n"); rc = -EINVAL; diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index f8a09e3eba58..6e1b252cea0e 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -822,7 +822,8 @@ static int __init rdac_init(void) /* * Create workqueue to handle mode selects for rdac */ - kmpath_rdacd = create_singlethread_workqueue("kmpath_rdacd"); + kmpath_rdacd = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "kmpath_rdacd"); if (!kmpath_rdacd) { scsi_unregister_device_handler(&rdac_dh); printk(KERN_ERR "kmpath_rdacd creation failed.\n"); diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c index 6a6ec32c46bd..9ac69356b13e 100644 --- a/drivers/scsi/elx/efct/efct_lio.c +++ b/drivers/scsi/elx/efct/efct_lio.c @@ -1114,7 +1114,8 @@ int efct_scsi_tgt_new_device(struct efct *efct) atomic_set(&efct->tgt_efct.watermark_hit, 0); atomic_set(&efct->tgt_efct.initiator_count, 0); - lio_wq = create_singlethread_workqueue("efct_lio_worker"); + lio_wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + "efct_lio_worker"); if (!lio_wq) { efc_log_err(efct, "workqueue create failed\n"); return -EIO; diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index c1a5ab662dc8..ff1fa3160c61 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c @@ -313,7 +313,8 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid, esas2r_fw_event_off(a); snprintf(a->fw_event_q_name, ESAS2R_KOBJ_NAME_LEN, "esas2r/%d", a->index); - a->fw_event_q = create_singlethread_workqueue(a->fw_event_q_name); + a->fw_event_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + a->fw_event_q_name); init_waitqueue_head(&a->buffered_ioctl_waiter); init_waitqueue_head(&a->nvram_waiter); diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c index 7d3b904af9e8..06357bbf6b2c 100644 --- a/drivers/scsi/fcoe/fcoe_sysfs.c +++ b/drivers/scsi/fcoe/fcoe_sysfs.c @@ -799,16 +799,16 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent, snprintf(ctlr->work_q_name, sizeof(ctlr->work_q_name), "ctlr_wq_%d", ctlr->id); - ctlr->work_q = create_singlethread_workqueue( - ctlr->work_q_name); + ctlr->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + ctlr->work_q_name); if (!ctlr->work_q) goto out_del; snprintf(ctlr->devloss_work_q_name, sizeof(ctlr->devloss_work_q_name), "ctlr_dl_wq_%d", ctlr->id); - ctlr->devloss_work_q = create_singlethread_workqueue( - ctlr->devloss_work_q_name); + ctlr->devloss_work_q = alloc_ordered_workqueue( + "%s", WQ_MEM_RECLAIM, ctlr->devloss_work_q_name); if (!ctlr->devloss_work_q) goto out_del_q; diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 29eead383eb9..0044717d4486 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -1161,14 +1161,16 @@ static int __init fnic_init_module(void) goto err_create_fnic_ioreq_slab; } - fnic_event_queue = create_singlethread_workqueue("fnic_event_wq"); + fnic_event_queue = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_event_wq"); if (!fnic_event_queue) { printk(KERN_ERR PFX "fnic work queue create failed\n"); err = -ENOMEM; goto err_create_fnic_workq; } - fnic_fip_queue = create_singlethread_workqueue("fnic_fip_q"); + fnic_fip_queue = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fnic_fip_q"); if (!fnic_fip_queue) { printk(KERN_ERR PFX "fnic FIP work queue create failed\n"); err = -ENOMEM; diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index ec1a3e7ee94d..6219807ce3b9 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2302,7 +2302,8 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) hisi_hba->last_slot_index = 0; - hisi_hba->wq = create_singlethread_workqueue(dev_name(dev)); + hisi_hba->wq = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, dev_name(dev)); if (!hisi_hba->wq) { dev_err(dev, "sas_alloc: failed to create workqueue\n"); goto err_out; diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index 2fca17cf8b51..639f72f28911 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3537,7 +3537,7 @@ static int ibmvscsis_probe(struct vio_dev *vdev, init_completion(&vscsi->unconfig); snprintf(wq_name, 24, "ibmvscsis%s", dev_name(&vdev->dev)); - vscsi->work_q = create_workqueue(wq_name); + vscsi->work_q = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, wq_name); if (!vscsi->work_q) { rc = -ENOMEM; dev_err(&vscsi->dev, "create_workqueue failed\n"); diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 1d91c457527f..f84a7e6ae379 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -2693,7 +2693,8 @@ int fc_setup_exch_mgr(void) fc_cpu_order = ilog2(roundup_pow_of_two(nr_cpu_ids)); fc_cpu_mask = (1 << fc_cpu_order) - 1; - fc_exch_workqueue = create_singlethread_workqueue("fc_exch_workqueue"); + fc_exch_workqueue = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + "fc_exch_workqueue"); if (!fc_exch_workqueue) goto err; return 0; diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index 33da3c1085f0..308cb4872f96 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c @@ -2263,7 +2263,8 @@ struct fc4_prov fc_rport_t0_prov = { */ int fc_setup_rport(void) { - rport_event_queue = create_singlethread_workqueue("fc_rport_eq"); + rport_event_queue = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "fc_rport_eq"); if (!rport_event_queue) return -ENOMEM; return 0; diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 9c8cc723170d..8566bb1208a0 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c @@ -122,12 +122,12 @@ int sas_register_ha(struct sas_ha_struct *sas_ha) error = -ENOMEM; snprintf(name, sizeof(name), "%s_event_q", dev_name(sas_ha->dev)); - sas_ha->event_q = create_singlethread_workqueue(name); + sas_ha->event_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name); if (!sas_ha->event_q) goto Undo_ports; snprintf(name, sizeof(name), "%s_disco_q", dev_name(sas_ha->dev)); - sas_ha->disco_q = create_singlethread_workqueue(name); + sas_ha->disco_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name); if (!sas_ha->disco_q) goto Undo_event_q; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 6c1fb8149553..1eec23da28e2 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1988,8 +1988,8 @@ megasas_fusion_start_watchdog(struct megasas_instance *instance) sizeof(instance->fault_handler_work_q_name), "poll_megasas%d_status", instance->host->host_no); - instance->fw_fault_work_q = - create_singlethread_workqueue(instance->fault_handler_work_q_name); + instance->fw_fault_work_q = alloc_ordered_workqueue( + "%s", WQ_MEM_RECLAIM, instance->fault_handler_work_q_name); if (!instance->fw_fault_work_q) { dev_err(&instance->pdev->dev, "Failed from %s %d\n", __func__, __LINE__); diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 6eb5bcd8e757..2e1a92d306b2 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2760,8 +2760,8 @@ void mpi3mr_start_watchdog(struct mpi3mr_ioc *mrioc) snprintf(mrioc->watchdog_work_q_name, sizeof(mrioc->watchdog_work_q_name), "watchdog_%s%d", mrioc->name, mrioc->id); - mrioc->watchdog_work_q = - create_singlethread_workqueue(mrioc->watchdog_work_q_name); + mrioc->watchdog_work_q = alloc_ordered_workqueue( + "%s", WQ_MEM_RECLAIM, mrioc->watchdog_work_q_name); if (!mrioc->watchdog_work_q) { ioc_err(mrioc, "%s: failed (line=%d)\n", __func__, __LINE__); return; diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index b2bcf4a27ddc..2d3eeda5a6a0 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -846,8 +846,8 @@ mpt3sas_base_start_watchdog(struct MPT3SAS_ADAPTER *ioc) snprintf(ioc->fault_reset_work_q_name, sizeof(ioc->fault_reset_work_q_name), "poll_%s%d_status", ioc->driver_name, ioc->id); - ioc->fault_reset_work_q = - create_singlethread_workqueue(ioc->fault_reset_work_q_name); + ioc->fault_reset_work_q = alloc_ordered_workqueue( + "%s", WQ_MEM_RECLAIM, ioc->fault_reset_work_q_name); if (!ioc->fault_reset_work_q) { ioc_err(ioc, "%s: failed (line=%d)\n", __func__, __LINE__); return; diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c index f684eb5e0489..140dc0e9cead 100644 --- a/drivers/scsi/myrb.c +++ b/drivers/scsi/myrb.c @@ -114,7 +114,8 @@ static bool myrb_create_mempools(struct pci_dev *pdev, struct myrb_hba *cb) snprintf(cb->work_q_name, sizeof(cb->work_q_name), "myrb_wq_%d", cb->host->host_no); - cb->work_q = create_singlethread_workqueue(cb->work_q_name); + cb->work_q = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, cb->work_q_name); if (!cb->work_q) { dma_pool_destroy(cb->dcdb_pool); cb->dcdb_pool = NULL; diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index e824be9d9bbb..8a8f26633cda 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -2208,7 +2208,8 @@ static bool myrs_create_mempools(struct pci_dev *pdev, struct myrs_hba *cs) snprintf(cs->work_q_name, sizeof(cs->work_q_name), "myrs_wq_%d", shost->host_no); - cs->work_q = create_singlethread_workqueue(cs->work_q_name); + cs->work_q = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, cs->work_q_name); if (!cs->work_q) { dma_pool_destroy(cs->dcdb_pool); cs->dcdb_pool = NULL; diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 4813087e58a1..119afcaf6e13 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -3374,7 +3374,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) sprintf(host_buf, "qedf_%u_link", qedf->lport->host->host_no); - qedf->link_update_wq = create_workqueue(host_buf); + qedf->link_update_wq = + alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update); INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery); INIT_DELAYED_WORK(&qedf->grcdump_work, qedf_wq_grcdump); @@ -3585,8 +3586,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) /* Start LL2 processing thread */ snprintf(host_buf, 20, "qedf_%d_ll2", host->host_no); - qedf->ll2_recv_wq = - create_workqueue(host_buf); + qedf->ll2_recv_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); if (!qedf->ll2_recv_wq) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to LL2 workqueue.\n"); rc = -ENOMEM; @@ -3629,7 +3629,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) sprintf(host_buf, "qedf_%u_timer", qedf->lport->host->host_no); qedf->timer_work_queue = - create_workqueue(host_buf); + alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); if (!qedf->timer_work_queue) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to start timer " "workqueue.\n"); @@ -3641,7 +3641,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) if (mode != QEDF_MODE_RECOVERY) { sprintf(host_buf, "qedf_%u_dpc", qedf->lport->host->host_no); - qedf->dpc_wq = create_workqueue(host_buf); + qedf->dpc_wq = + alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); } INIT_DELAYED_WORK(&qedf->recovery_work, qedf_recovery_handler); @@ -4182,7 +4183,7 @@ static int __init qedf_init(void) goto err3; } - qedf_io_wq = create_workqueue("qedf_io_wq"); + qedf_io_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, "qedf_io_wq"); if (!qedf_io_wq) { QEDF_ERR(NULL, "Could not create qedf_io_wq.\n"); goto err4; diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index cd0180b1f5b9..319c1da549f7 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -2767,7 +2767,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) } sprintf(host_buf, "host_%d", qedi->shost->host_no); - qedi->tmf_thread = create_singlethread_workqueue(host_buf); + qedi->tmf_thread = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, host_buf); if (!qedi->tmf_thread) { QEDI_ERR(&qedi->dbg_ctx, "Unable to start tmf thread!\n"); @@ -2776,7 +2777,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) } sprintf(host_buf, "qedi_ofld%d", qedi->shost->host_no); - qedi->offload_thread = create_workqueue(host_buf); + qedi->offload_thread = + alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); if (!qedi->offload_thread) { QEDI_ERR(&qedi->dbg_ctx, "Unable to start offload thread!\n"); diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index bc3b2aea3f8b..7f980e6141c2 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -3501,11 +3501,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) if (IS_QLA8031(ha) || IS_MCTP_CAPABLE(ha)) { sprintf(wq_name, "qla2xxx_%lu_dpc_lp_wq", base_vha->host_no); - ha->dpc_lp_wq = create_singlethread_workqueue(wq_name); + ha->dpc_lp_wq = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name); INIT_WORK(&ha->idc_aen, qla83xx_service_idc_aen); sprintf(wq_name, "qla2xxx_%lu_dpc_hp_wq", base_vha->host_no); - ha->dpc_hp_wq = create_singlethread_workqueue(wq_name); + ha->dpc_hp_wq = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name); INIT_WORK(&ha->nic_core_reset, qla83xx_nic_core_reset_work); INIT_WORK(&ha->idc_state_handler, qla83xx_idc_state_handler_work); diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 17cccd14765f..d91f54a6e752 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -8806,7 +8806,7 @@ static int qla4xxx_probe_adapter(struct pci_dev *pdev, DEBUG2(printk("scsi: %s: Starting kernel thread for " "qla4xxx_dpc\n", __func__)); sprintf(buf, "qla4xxx_%lu_dpc", ha->host_no); - ha->dpc_thread = create_singlethread_workqueue(buf); + ha->dpc_thread = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, buf); if (!ha->dpc_thread) { ql4_printk(KERN_WARNING, ha, "Unable to start DPC thread!\n"); ret = -ENODEV; diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c index abc78320c66d..79ffcf796b05 100644 --- a/drivers/scsi/snic/snic_main.c +++ b/drivers/scsi/snic/snic_main.c @@ -302,7 +302,8 @@ snic_add_host(struct Scsi_Host *shost, struct pci_dev *pdev) SNIC_BUG_ON(shost->work_q != NULL); snprintf(shost->work_q_name, sizeof(shost->work_q_name), "scsi_wq_%d", shost->host_no); - shost->work_q = create_singlethread_workqueue(shost->work_q_name); + shost->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, + shost->work_q_name); if (!shost->work_q) { SNIC_HOST_ERR(shost, "Failed to Create ScsiHost wq.\n"); @@ -884,7 +885,8 @@ snic_global_data_init(void) snic_glob->req_cache[SNIC_REQ_TM_CACHE] = cachep; /* snic_event queue */ - snic_glob->event_q = create_singlethread_workqueue("snic_event_wq"); + snic_glob->event_q = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, "snic_event_wq"); if (!snic_glob->event_q) { SNIC_ERR("snic event queue create failed\n"); ret = -ENOMEM; diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 8ffb75be99bc..fbee7db4a835 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -1797,7 +1797,8 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id) snprintf(hba->work_q_name, sizeof(hba->work_q_name), "stex_wq_%d", host->host_no); - hba->work_q = create_singlethread_workqueue(hba->work_q_name); + hba->work_q = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, hba->work_q_name); if (!hba->work_q) { printk(KERN_ERR DRV_NAME "(%s): create workqueue failed\n", pci_name(pdev)); diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index c4fea077265e..32242d86cf5b 100644 --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c @@ -1137,7 +1137,8 @@ static int pvscsi_setup_msg_workqueue(struct pvscsi_adapter *adapter) snprintf(name, sizeof(name), "vmw_pvscsi_wq_%u", adapter->host->host_no); - adapter->workqueue = create_singlethread_workqueue(name); + adapter->workqueue = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, name); if (!adapter->workqueue) { printk(KERN_ERR "vmw_pvscsi: failed to create work queue\n"); return 0; diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 0dd26059f5d7..bc00603a6837 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -1819,7 +1819,8 @@ static void ufshcd_init_clk_scaling(struct ufs_hba *hba) snprintf(wq_name, sizeof(wq_name), "ufs_clkscaling_%d", hba->host->host_no); - hba->clk_scaling.workq = create_singlethread_workqueue(wq_name); + hba->clk_scaling.workq = + alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name); hba->clk_scaling.is_initialized = true; } @@ -10463,7 +10464,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) /* Initialize work queues */ snprintf(eh_wq_name, sizeof(eh_wq_name), "ufs_eh_wq_%d", hba->host->host_no); - hba->eh_wq = create_singlethread_workqueue(eh_wq_name); + hba->eh_wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, eh_wq_name); if (!hba->eh_wq) { dev_err(hba->dev, "%s: failed to create eh workqueue\n", __func__); From patchwork Thu Aug 22 19:59:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822114 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 592BE37700 for ; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356818; cv=none; b=cN4SzOgk9JMawkOmnceNxV0wZRcilUGN8jYimYyJTOoao9v8oW33Ibu1OJ6Q6JFArEovF2cB64Hou36zVMqLF7MjzQTXIj+9C09eUyIT7vXB+8zIWfQyuLZG3WCs1OcPH3TT8w4mHGXjGNoX4Umnje/2vBZvonDN/B81U8vFOe4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356818; c=relaxed/simple; bh=o10ljLmONycsnD5xQJZYaGnLPjqhRC6/yapUKzQ4TAs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tHgpcQgV+I/uW18rzd6JiiijPWFCfN6Q7IVGV2edrf0xFCHRmAu/XjjYZF4HFvLIC8Gl9jPB/Q6sWj8txyaCnSukpb25o3DskOPzbv/XDYMPzOXjPGdGrzw8ElxtNL6RLSQNiRgaIm9O65IwTBG28pV3SQyYr4oe1g0skNdz5ow= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=YkcDobKf; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="YkcDobKf" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw05wg7z6ClY9S; Thu, 22 Aug 2024 20:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356812; x=1726948813; bh=NOhjZ YZgYhNzxOBwIteWrZ1e+yhklFzUfYuAEEbHfWY=; b=YkcDobKf0RGhSBstPM/dq EsKgaBt7zLMZBQZogm8vCPFlzLouYmOumfhLuPBIlVj5xsEH0fOH1M/gzVFGiG0n OVhIkJsV6YgkmS82ApGUEx2C7zexcTamEF9SHwg2kmxaJ6MRHHZb4RxOQqT0e16D UxJ0fZn7IrjR/MxIN9kTXIS/sWuBdjjBJlNBYd+qL8eCLsfXSHBIDb8oEsO8r19/ 6tXnRfqluFVWARjQzCB/IAvKeQvN/oS5UwQPVPhaJ9xxiHKVQdyLxvN4BBho2u9V KHy4TSlDQ7A90Unb9eP9MfCRcAnvJFoXhzS1BrivAX70sI7nmw3kqZOhooqRp9iM A== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id t5Xv6Qu1WpWg; Thu, 22 Aug 2024 20:00:12 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYvv3yPDz6ClY9L; Thu, 22 Aug 2024 20:00:11 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani Subject: [PATCH v3 02/18] scsi: mptfusion: Simplify the alloc*_workqueue() invocations Date: Thu, 22 Aug 2024 12:59:06 -0700 Message-ID: <20240822195944.654691-3-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc*_workqueue() format the workqueue names instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/message/fusion/mptbase.c | 10 +++------- drivers/message/fusion/mptbase.h | 3 --- drivers/message/fusion/mptfc.c | 7 ++----- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 4bf669c55649..738bc4e60a18 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1856,10 +1856,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) /* Initialize workqueue */ INIT_DELAYED_WORK(&ioc->fault_reset_work, mpt_fault_reset_work); - snprintf(ioc->reset_work_q_name, MPT_KOBJ_NAME_LEN, - "mpt_poll_%d", ioc->id); - ioc->reset_work_q = alloc_workqueue(ioc->reset_work_q_name, - WQ_MEM_RECLAIM, 0); + ioc->reset_work_q = + alloc_workqueue("mpt_poll_%d", WQ_MEM_RECLAIM, 0, ioc->id); if (!ioc->reset_work_q) { printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n", ioc->name); @@ -1986,9 +1984,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) INIT_LIST_HEAD(&ioc->fw_event_list); spin_lock_init(&ioc->fw_event_lock); - snprintf(ioc->fw_event_q_name, MPT_KOBJ_NAME_LEN, "mpt/%d", ioc->id); - ioc->fw_event_q = alloc_workqueue(ioc->fw_event_q_name, - WQ_MEM_RECLAIM, 0); + ioc->fw_event_q = alloc_workqueue("mpt/%d", WQ_MEM_RECLAIM, 0, ioc->id); if (!ioc->fw_event_q) { printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n", ioc->name); diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index 8031173c3655..b406fd676da0 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h @@ -729,7 +729,6 @@ typedef struct _MPT_ADAPTER struct list_head fw_event_list; spinlock_t fw_event_lock; u8 fw_events_off; /* if '1', then ignore events */ - char fw_event_q_name[MPT_KOBJ_NAME_LEN]; struct mutex sas_discovery_mutex; u8 sas_discovery_runtime; @@ -764,7 +763,6 @@ typedef struct _MPT_ADAPTER u8 fc_link_speed[2]; spinlock_t fc_rescan_work_lock; struct work_struct fc_rescan_work; - char fc_rescan_work_q_name[MPT_KOBJ_NAME_LEN]; struct workqueue_struct *fc_rescan_work_q; /* driver forced bus resets count */ @@ -778,7 +776,6 @@ typedef struct _MPT_ADAPTER spinlock_t scsi_lookup_lock; u64 dma_mask; u32 broadcast_aen_busy; - char reset_work_q_name[MPT_KOBJ_NAME_LEN]; struct workqueue_struct *reset_work_q; struct delayed_work fault_reset_work; diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index a3c17c4fe69c..91242f26defb 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -1349,11 +1349,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* initialize workqueue */ - snprintf(ioc->fc_rescan_work_q_name, sizeof(ioc->fc_rescan_work_q_name), - "mptfc_wq_%d", sh->host_no); - ioc->fc_rescan_work_q = - alloc_ordered_workqueue(ioc->fc_rescan_work_q_name, - WQ_MEM_RECLAIM); + ioc->fc_rescan_work_q = alloc_ordered_workqueue( + "mptfc_wq_%d", WQ_MEM_RECLAIM, sh->host_no); if (!ioc->fc_rescan_work_q) { error = -ENOMEM; goto out_mptfc_host; From patchwork Thu Aug 22 19:59:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821613 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 885A318028 for ; Thu, 22 Aug 2024 20:00:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356817; cv=none; b=f5CIlvj4JDAGVtoa8WEqz8a+Y5BFr6ROoXjwymeYw78cN5wt22s45IPIIeYzFkKEZd+TvXnGXW2bYT0pBnhy8DpB8MQ3Ve/tO0H6WddJAWrLmTme/27XK+jkgJ9roS0hkOGp1DfraN9rmdjjNo3V15rtrsaIhQ1p7leeiupACyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356817; c=relaxed/simple; bh=cgtOvADPeSF14nGQHjloqhw+5tHnH3QyTV7vyu1OuiU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l6SG602Sh/aZGv4fzUkRJw3NeU5RTy8oC+R8llhrKRWS/yBMU5SjV6z3ehlI+aVS0mq/pH7qwYIDnPnqvuIeBkaZFYWmcYmNkgIcqU08Y3rVD5o1tqirIJsDcuVpk59Gtva34BFp7PF5RJlBLVg2LjeXvGbyUKXbkXZHGMxUUjs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=TxYfhW6J; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="TxYfhW6J" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYvy75NTz6ClY9Q; Thu, 22 Aug 2024 20:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356812; x=1726948813; bh=fqvIk ghVilRYJVAJ2j3innOMRcrBOb5gndIaWzePiOA=; b=TxYfhW6JHPz9JqjCcLHLc Vzu6GdS4BU5Jbn1KlYgDAoKNMhA4gDFG8hcjmOdY6p1Fge/fb1zmO23MzpBBDBO1 /D5cAYPsdfWh91nNmOIn8mBAzVCyeGXWTgcjorTB3OOF9mcIBkbWDpBLiN5M2MkF EPkt0XMW+0prR66q1OPpbXY+fyV2r+DALABSzwET0lD32UCQ699b1UFKU/yQxPD9 j8aCmoDC2dxLNUeMY4wukJTs4yCB+CGZmUsiu9b7aLzsudezSJn7x+/hP4C/ivXN jNGlCzwoj0Cj3fC4B9Vhgg7TnHI8NBRJd6DL62VpkYXDgCoC0/Egc8A1w1csIQFw Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id ADPqwe1h_g8z; Thu, 22 Aug 2024 20:00:12 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYvw2Sr3z6ClY9M; Thu, 22 Aug 2024 20:00:12 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Ketan Mukadam , "James E.J. Bottomley" Subject: [PATCH v3 03/18] scsi: be2iscsi: Simplify an alloc_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:07 -0700 Message-ID: <20240822195944.654691-4-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/be2iscsi/be_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 06acb5ff609e..76a1e373386e 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -5528,7 +5528,6 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, struct beiscsi_hba *phba = NULL; struct be_eq_obj *pbe_eq; unsigned int s_handle; - char wq_name[20]; int ret, i; ret = beiscsi_enable_pci(pcidev); @@ -5634,9 +5633,8 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, phba->ctrl.mcc_alloc_index = phba->ctrl.mcc_free_index = 0; - snprintf(wq_name, sizeof(wq_name), "beiscsi_%02x_wq", - phba->shost->host_no); - phba->wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, wq_name); + phba->wq = alloc_workqueue("beiscsi_%02x_wq", WQ_MEM_RECLAIM, 1, + phba->shost->host_no); if (!phba->wq) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, "BM_%d : beiscsi_dev_probe-" From patchwork Thu Aug 22 19:59:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822113 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78491166F29 for ; Thu, 22 Aug 2024 20:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356820; cv=none; b=FafUQyHs4CRpSmLQuuEGc8KR2v7arMjqdBX3dXNusFKQ22uU+IBaV5G+sOAIq22mPMxcPAyOW1R+1daR+frW1t+XCt83mTKfxdkOIizHPKWRCNQZNu4Y6c8ULXWqlDSmc7MIWDFoGujUW71gPjDowVDe7TOzLtHT9yq8wKOM/co= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356820; c=relaxed/simple; bh=Tea0nRLl/F6rTeBQtk9RSleCCvVwpm/DCk44+A+OIYI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dkfS07sLHCR58LWcqalGoZYJrOsrSlxZFL8vv6GrjJzW0vOl26klk99r3yJHDA39nHdzdIcbT4hdoq5fIKP4Sjw1oCqmjXkFuF1cUULJ5C+Ldzd/heuguBMi69TTvDiEmp9IT7Z+tkvJowv0TuLZD76tiFj1qcj9+CbVwDs9y6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=nwykaJZe; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="nwykaJZe" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw14yFNz6ClY9P; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356815; x=1726948816; bh=dIV0M zTqKSLs75pRHwjZv9wzy9UkaqXuwG2DQwhD2hE=; b=nwykaJZeHbWEduf/2u6ep 1IVF453FvdjBrIyTbNW/uB207VqN8JAfRoQVTMBjMnoNAyAk/2RnvOtJhtz2CREh d/yNucGq8kCAxaam9svTZYVYpIQJbYgQVPrYu+X89ooxQEW4QBa98yw5NIuKkK18 2c6q+K+8qUy036cVFqh3RmCmATA0RkMEGc4gIoexv06oYZsE/LvmVrXK0A6/dJSQ U5wlfjVs9qGYhoSNehHjn1H0/9jCoIoiXfgIZOsMv7w0t8FUwAL+D6SMrWHdV9KQ GbiKsP8z2V4XB3cdB3HrUIF0CA6VxrLpBkuD0s8kmwKGLP0DHFpQLZIv19aLjoU2 Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id fwW7ZZoQR86C; Thu, 22 Aug 2024 20:00:15 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYvx0bQyz6ClY9K; Thu, 22 Aug 2024 20:00:12 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Anil Gurumurthy , Sudarsana Kalluru , "James E.J. Bottomley" Subject: [PATCH v3 04/18] scsi: bfa: Simplify an alloc_ordered_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:08 -0700 Message-ID: <20240822195944.654691-5-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/bfa/bfad_im.c | 6 ++---- drivers/scsi/bfa/bfad_im.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index a1d015356063..66fb701401de 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -766,10 +766,8 @@ bfad_thread_workq(struct bfad_s *bfad) struct bfad_im_s *im = bfad->im; bfa_trc(bfad, 0); - snprintf(im->drv_workq_name, KOBJ_NAME_LEN, "bfad_wq_%d", - bfad->inst_no); - im->drv_workq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, - im->drv_workq_name); + im->drv_workq = alloc_ordered_workqueue("bfad_wq_%d", WQ_MEM_RECLAIM, + bfad->inst_no); if (!im->drv_workq) return BFA_STATUS_FAILED; diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h index 4353feedf76a..0884af04bd1f 100644 --- a/drivers/scsi/bfa/bfad_im.h +++ b/drivers/scsi/bfa/bfad_im.h @@ -134,7 +134,6 @@ struct bfad_fcp_binding { struct bfad_im_s { struct bfad_s *bfad; struct workqueue_struct *drv_workq; - char drv_workq_name[KOBJ_NAME_LEN]; struct work_struct aen_im_notify_work; }; From patchwork Thu Aug 22 19:59:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821612 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E259D13AA4E for ; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356819; cv=none; b=uOoAYApCLPD67eaPrkXZywEVWrjITrNdUyZGL1J9ZRv/4g+wIO1fbBdxqIWWOTLdoKZ+mTaFjpFlUsDAe93lHrYxl5eqx/RS6HzfwY9QbCvJQCtn2BMdFA09+sh3GQoRdIbYVPagoFQU37TQDMTSFTSfF+sMdl5fM9RAV34KVqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356819; c=relaxed/simple; bh=loXYXyFcPHxSm4oGA5Hka00d64Otm7zUReO1qVODTH4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n6sigu8VLFUW0pXXIVE6ylgiQrUFQEUChqhU7HWy0nryEhqijvWUNiqI6B+WAR/G4vB5gFU8TFbvszIOyzB+s9sQmOJtUpDbJPQHNUGb3h/UrCvIBy4G1H6C6mjK+h4Z/USNJIvsO2b+k/UrZ4VKFyGOvPzUymslp6scV8bDf2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=dKl4yndW; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="dKl4yndW" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw14d7Gz6ClY9T; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356815; x=1726948816; bh=ope2b Zgdg6uen/17iF5cq5qvjLUE3R35vW81Zdlofic=; b=dKl4yndWGVZIDZ6QdLHVs me6v2KEl5HAIjxiQ2fNZ+veXNphj8jrF7EV7zXMSCWX7WI1Rz6x2D2UeekSM8y15 tY5a/zR/6S61MikUGLGGAyb/91YgXhGYKYH3ee4c+qUaZocmvmUL5kUL3RZWNoLu 7hTFOlJ5dF30OTB8iD4WMJKXpYnIXPin0flJQqmx/3rmuBXHo8m8h/f6sa0SMmgv ai61RI4SDf2kRn7RlY66JC3Tg5CUrn2FbhQJu60UuT3rXA55OI7RFmDK9hj/R/M6 RVH71DQiDp4pVeymomRNwQr8jJlnd9TjjsS8RuFCKaWS7ppDKdNCTnlWULXXWE+v A== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id QmZiU9EhslSz; Thu, 22 Aug 2024 20:00:15 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYvx6bFdz6ClY9P; Thu, 22 Aug 2024 20:00:13 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Bradley Grove , "James E.J. Bottomley" Subject: [PATCH v3 05/18] scsi: esas2r: Simplify an alloc_ordered_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:09 -0700 Message-ID: <20240822195944.654691-6-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/esas2r/esas2r.h | 1 - drivers/scsi/esas2r/esas2r_init.c | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r.h b/drivers/scsi/esas2r/esas2r.h index ed63f7a9ea54..8a133254c4f6 100644 --- a/drivers/scsi/esas2r/esas2r.h +++ b/drivers/scsi/esas2r/esas2r.h @@ -929,7 +929,6 @@ struct esas2r_adapter { struct list_head fw_event_list; spinlock_t fw_event_lock; u8 fw_events_off; /* if '1', then ignore events */ - char fw_event_q_name[ESAS2R_KOBJ_NAME_LEN]; /* * intr_mode stores the interrupt mode currently being used by this * adapter. it is based on the interrupt_mode module parameter, but diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index ff1fa3160c61..0cea5f3d1a08 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c @@ -311,10 +311,8 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid, sema_init(&a->nvram_semaphore, 1); esas2r_fw_event_off(a); - snprintf(a->fw_event_q_name, ESAS2R_KOBJ_NAME_LEN, "esas2r/%d", - a->index); - a->fw_event_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, - a->fw_event_q_name); + a->fw_event_q = + alloc_ordered_workqueue("esas2r/%d", WQ_MEM_RECLAIM, a->index); init_waitqueue_head(&a->buffered_ioctl_waiter); init_waitqueue_head(&a->nvram_waiter); From patchwork Thu Aug 22 19:59:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822112 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FC691CDFCE for ; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356822; cv=none; b=Og/VUgpAoJlQCVmzYXH7BluAuhshO9SA5kkPcxby//vMnzLESMk1dMgOW1qofjQdXu6Ny5/VQUF3DuWdhXnR3IadW+o6AwD1qG/m/2FrXCJw3Vf1tF56U89JpYpI0/FzegQoGMWj1KVd8cpvj12/0rVHNlKJg1tgePYejwbpRV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356822; c=relaxed/simple; bh=lyWPRMevCNtWhTOSxORGERWH0uuAJLeJ550K2/e1G18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PHTJSBa9JiIVdzBpbLn2ATIn8tgESFNYg0uxAfLVNswucFzULDF6cAlxGmpouApARXqr6SQRk1Xh4nJPE9VkcwKEZmiaHMyakuuGTLsqcmz/jeoCJGn7SHEuDpTmOzhhMufAi3EEYH7PsU8rvj1ugoFTc80UeOSTO0fh1WUE8oQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=FjubeGn+; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="FjubeGn+" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw341Ytz6ClY9M; Thu, 22 Aug 2024 20:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356816; x=1726948817; bh=+tcv1 IVee5zSJiAzD8IyeZ6+jN0+Kw+2RPNa8uwxOBo=; b=FjubeGn+LiYUgJ7wwpXNR KcRPEU4YsM6fgHDLmKi3lgPdHGg/UiWoZmXpGtrwjix5au4d7VU+aQygXblSwKrL GayJLBaLx77rRhqVqmCmac8xugIm/Cua2sLQgKNzCem/eLRXJmLG3zi3EghbRDdh FC4FuXaBftY4OCqXMXLs1rHSv19wlaMVtYnhnZVDBY/6/r0Q724agauONu+S8gHv Wvrg6kRn3y5pt5BZt6unmTpC11Y+gWg4VgGSqpqaoAduzWIEbfzFgt/SOzIqEFi4 dQRAp2+LqFIB9dlOde+8FeUxVtdCTiXZZcp5MyuIZSvzYUlaoBWnipuumapl3mHx Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id RbxvObZKGBVj; Thu, 22 Aug 2024 20:00:16 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYvy4k22z6ClY9N; Thu, 22 Aug 2024 20:00:14 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , "James E.J. Bottomley" Subject: [PATCH v3 06/18] scsi: fcoe: Simplify alloc_ordered_workqueue() invocations Date: Thu, 22 Aug 2024 12:59:10 -0700 Message-ID: <20240822195944.654691-7-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/scsi/fcoe/fcoe_sysfs.c | 18 +++++------------- include/scsi/fcoe_sysfs.h | 2 -- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c index 06357bbf6b2c..0609ca6b9353 100644 --- a/drivers/scsi/fcoe/fcoe_sysfs.c +++ b/drivers/scsi/fcoe/fcoe_sysfs.c @@ -45,12 +45,8 @@ MODULE_PARM_DESC(fcf_dev_loss_tmo, */ #define fcoe_ctlr_id(x) \ ((x)->id) -#define fcoe_ctlr_work_q_name(x) \ - ((x)->work_q_name) #define fcoe_ctlr_work_q(x) \ ((x)->work_q) -#define fcoe_ctlr_devloss_work_q_name(x) \ - ((x)->devloss_work_q_name) #define fcoe_ctlr_devloss_work_q(x) \ ((x)->devloss_work_q) #define fcoe_ctlr_mode(x) \ @@ -797,18 +793,14 @@ struct fcoe_ctlr_device *fcoe_ctlr_device_add(struct device *parent, ctlr->fcf_dev_loss_tmo = fcoe_fcf_dev_loss_tmo; - snprintf(ctlr->work_q_name, sizeof(ctlr->work_q_name), - "ctlr_wq_%d", ctlr->id); - ctlr->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, - ctlr->work_q_name); + ctlr->work_q = alloc_ordered_workqueue("ctlr_wq_%d", WQ_MEM_RECLAIM, + ctlr->id); if (!ctlr->work_q) goto out_del; - snprintf(ctlr->devloss_work_q_name, - sizeof(ctlr->devloss_work_q_name), - "ctlr_dl_wq_%d", ctlr->id); - ctlr->devloss_work_q = alloc_ordered_workqueue( - "%s", WQ_MEM_RECLAIM, ctlr->devloss_work_q_name); + ctlr->devloss_work_q = alloc_ordered_workqueue("ctlr_dl_wq_%d", + WQ_MEM_RECLAIM, + ctlr->id); if (!ctlr->devloss_work_q) goto out_del_q; diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h index 4b1216de3f22..2b28a05e492b 100644 --- a/include/scsi/fcoe_sysfs.h +++ b/include/scsi/fcoe_sysfs.h @@ -50,9 +50,7 @@ struct fcoe_ctlr_device { struct fcoe_sysfs_function_template *f; struct list_head fcfs; - char work_q_name[20]; struct workqueue_struct *work_q; - char devloss_work_q_name[20]; struct workqueue_struct *devloss_work_q; struct mutex lock; From patchwork Thu Aug 22 19:59:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821611 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3CBF16C684 for ; Thu, 22 Aug 2024 20:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356821; cv=none; b=WvLR6mHpnZSlkS5ONv9ltOBe8X0x3wW+FtipUmtX+9O6IpyVoqs1n3GoqKnlv1pUd8vR+6HJChg4Mq0CFHbZFTh8Yd3nUA+HC+/LCwS4sMpRe7O9+vRMUWsY1MeJnVCbbmq19nZy8n1WkekTjXEfIE1WZuqDGCTMise3zAbOy0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356821; c=relaxed/simple; bh=k8xnEwjxncBmibJ9rb/duQSAGGar3W77zTxGI5zxoEo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nhHpxvXyU2yXKtL/PE0+RaAUbk5/B9g9+piKcP6uQiI00ggQQZbh9kxlYNRdpKznx3g8lZ3K1SJbzmDXrWDaQj6agJUS7B2nMdzdEtxYjj9dE+Q68bpqxvrljZcDfPBvukgl/LICJK5fQlg/GVusNf4pk9xCH3V/BPFg2hGPnp4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=dG+Mf3un; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="dG+Mf3un" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw32Gy1z6ClY9V; Thu, 22 Aug 2024 20:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356816; x=1726948817; bh=7huO0 lWghV3UcNebybQ0VORXyW0Ba/Jtu3bltncobaM=; b=dG+Mf3unkAU5VkPo3aAqb 1LT9aod9fsdDOnzSphcyORdy7AyASNXnimXWEHWPIwbRtwLxJD79izvjWTPfCZAc W0Y/RLfnCG+g0HymIoWi+JZdK6gXMzAJFq3ty4bqkupy+kG2Az297GUmRreT39lz c1Do+9LwHxrCEUXOaQU9DQB/InzGlbTdLkPYjrBz1okxYSIXZ5iNxPRzne1668WQ KpYCnN1wjg3RxNLk4phtcqWYHcKLdbu0N9GpbrAEi+k64+pIdEdbjgIE2b83RSME wqNqrRl2T9z4bOg75vf026kgtAz3OzLe5T7mK6dS2B/OLX1bEChZw15Q8kEKS8XG g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id vDiAb73oNaDx; Thu, 22 Aug 2024 20:00:16 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYvz2X1jz6ClY9M; Thu, 22 Aug 2024 20:00:15 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Tyrel Datwyler , "James E.J. Bottomley" Subject: [PATCH v3 07/18] scsi: ibmvscsi_tgt: Simplify an alloc_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:11 -0700 Message-ID: <20240822195944.654691-8-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index 639f72f28911..16d085d56e9d 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3425,7 +3425,6 @@ static int ibmvscsis_probe(struct vio_dev *vdev, struct scsi_info *vscsi; int rc = 0; long hrc = 0; - char wq_name[24]; vscsi = kzalloc(sizeof(*vscsi), GFP_KERNEL); if (!vscsi) { @@ -3536,8 +3535,8 @@ static int ibmvscsis_probe(struct vio_dev *vdev, init_completion(&vscsi->wait_idle); init_completion(&vscsi->unconfig); - snprintf(wq_name, 24, "ibmvscsis%s", dev_name(&vdev->dev)); - vscsi->work_q = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, wq_name); + vscsi->work_q = alloc_workqueue("ibmvscsis%s", WQ_MEM_RECLAIM, 1, + dev_name(&vdev->dev)); if (!vscsi->work_q) { rc = -ENOMEM; dev_err(&vscsi->dev, "create_workqueue failed\n"); From patchwork Thu Aug 22 19:59:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821609 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B61FD1D0DE3 for ; Thu, 22 Aug 2024 20:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356825; cv=none; b=FsDGkBWV/eMv4+dVLw3W9bzJVVNAfKaCah+qnez3pTfC5Vo52rkA/I48s2so0x9mrw/eOvCLxsKQss9qnuIjySccGXyefhZUJ5UrHg/RZ7aZ2KpFaQkAaFxkWVQaeFBSY0JM5+3fewP1G5tGslv5EgjGcF38mfjBl6DGgS/BfNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356825; c=relaxed/simple; bh=olUflGePI8UC7pbPjQF243zd138PFVIYAD+oNAvagPs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=epSGk6bcDyk+uFNVfmpHNZYo3ExjlBEaWH+3UiT0JHkGVlHAg5nBEcx2wVQKdeLBGm+1wCp+knyAKFa+An0PICuzjLrpkINAbBtQl8LJGtfxCXM+6PKXlCNpLGRi3lasJbZS1AvM92nNd7fYp8eYgywdiSP3yg8mnDxfcaaUP/g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=UFMvAuae; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="UFMvAuae" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw54Jzzz6ClY9L; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356817; x=1726948818; bh=Nf/Y4 zec52rhkP1REqo6mtxk3dwMrtOi3jDm4vxsJuQ=; b=UFMvAuaeoyxTVJd6bTQLb bOoItBGdwFW4xbmc9FybRhdNbr1ueyUpSVoTQZl9cXECXpKYN+nWZs+8FZkzE69n W/O78iKrwMC4EocD+TQtuY9OHSPFLKKGJSh64jO08j5PgfqQVymGm2EN0QeVW6mx Rp07ABz+YFT6HnmW5I23NdQlocyJ7QIQRvm3Kr92nzfqcUFc1V3WRO1BC9PezKYf IURzvOHRpDNnsgxmQuDtnbt43XHSkwIT9uVC0oPf6zlUKKR0iqJLyB1RZfaMBRFp V91XxfCbhz2WwdWt/IKsgY01iQ4+N6U9tFL2IboBplcVTYMbOWN8YHe0+Ipm5Vuh w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 0QQpwSyznUGP; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw00k0hz6ClY9R; Thu, 22 Aug 2024 20:00:15 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Sathya Prakash Veerichetty , Kashyap Desai , Sumit Saxena , Sreekanth Reddy , "James E.J. Bottomley" Subject: [PATCH v3 08/18] scsi: mpi3mr: Simplify an alloc_ordered_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:12 -0700 Message-ID: <20240822195944.654691-9-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/mpi3mr/mpi3mr.h | 2 -- drivers/scsi/mpi3mr/mpi3mr_os.c | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h index 875bad7538f2..1dc640de3efc 100644 --- a/drivers/scsi/mpi3mr/mpi3mr.h +++ b/drivers/scsi/mpi3mr/mpi3mr.h @@ -1060,7 +1060,6 @@ struct scmd_priv { * @sbq_lock: Sense buffer queue lock * @sbq_host_index: Sense buffer queuehost index * @event_masks: Event mask bitmap - * @fwevt_worker_name: Firmware event worker thread name * @fwevt_worker_thread: Firmware event worker thread * @fwevt_lock: Firmware event lock * @fwevt_list: Firmware event list @@ -1241,7 +1240,6 @@ struct mpi3mr_ioc { u32 sbq_host_index; u32 event_masks[MPI3_EVENT_NOTIFY_EVENTMASK_WORDS]; - char fwevt_worker_name[MPI3MR_NAME_LENGTH]; struct workqueue_struct *fwevt_worker_thread; spinlock_t fwevt_lock; struct list_head fwevt_list; diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 69b14918de59..e18c44b53b99 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -5305,10 +5305,8 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id) else scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); - snprintf(mrioc->fwevt_worker_name, sizeof(mrioc->fwevt_worker_name), - "%s%d_fwevt_wrkr", mrioc->driver_name, mrioc->id); mrioc->fwevt_worker_thread = alloc_ordered_workqueue( - mrioc->fwevt_worker_name, 0); + "%s%d_fwevt_wrkr", 0, mrioc->driver_name, mrioc->id); if (!mrioc->fwevt_worker_thread) { ioc_err(mrioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); From patchwork Thu Aug 22 19:59:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822111 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B6831D04BB for ; Thu, 22 Aug 2024 20:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356824; cv=none; b=kCIsDjVT7TiuBZirHiYUZOEOhvndVPHMeF/f4FnW11QjtToPNQ+Qw1KBy82CPoFx3tSFI737AytnIW2Rvcw6BuFjp6qdyKlE2PsxVLtYoVPP8XzdBbqH95XFrObIhupS1B6IFdXcjV11eDEElBaxjo+YwgM7n8ASI7GbEVMHoL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356824; c=relaxed/simple; bh=k4PBo4mfMMz3UI4rzFpdLw+5lUCMAfBrhHnCxrDX7t0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jeje3wkm2xdIRGKaPJCsu3RuSLcVqJo590HKc9X8stRfvAP39rdLBxEwxgK0AvankZodwWHsC4dAzKj5pAQYRjKRd1zZlnqsUYYX4UuFg4rt+HWl/gGBVfdQaIv5PiTqFyueTlqYJkByw2AomuAdO8a/lslRBBLOGgP2uG5N4qM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=oQIVZsJl; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="oQIVZsJl" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw53zgxz6ClY9X; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356817; x=1726948818; bh=lxlYv 6PbXemYJd0JwWkkY873WX0sYrHCusWF34TE2Hw=; b=oQIVZsJlQd4vP89P6ba3o Vn91xHpF5pmoJfhD+gDHNLPJUTWAIG3QuNb0zdh4AFmy6u0oqTPHwL4GLuQOXIs2 vi6jzPW2cBNJiJCaOMjZvjln1YP5+GhyFQPPy4k8TIE/GBsVOULwOBmV2t35p+Sp JtThqXhrP0vOpfqPZh7iegm1y51fGqDCS88fmuMpgTxZ1EbcFaPMcFwFwsnqYkzD vUeN3y+k6J1/FF5Zhhv52+Id1byVbS4qWbe6a8HMUd8alFBOBBNaBO4JdI0NPL8r LXxLNO91eMvrcyLBksxx5MThAoyLUpDh58ZmTKBLh/DCIIP83AkNU4qyi1B+goTw A== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id Jx28A0hR5qKX; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw111tzz6ClY9L; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , "James E.J. Bottomley" Subject: [PATCH v3 09/18] scsi: mpt3sas: Simplify an alloc_ordered_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:13 -0700 Message-ID: <20240822195944.654691-10-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 +--- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index fe1e96fda284..eceb5eeb4651 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -1162,8 +1162,7 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc); * @fault_reset_work_q_name: fw fault work queue * @fault_reset_work_q: "" * @fault_reset_work: "" - * @firmware_event_name: fw event work queue - * @firmware_event_thread: "" + * @firmware_event_thread: fw event work queue * @fw_event_lock: * @fw_event_list: list of fw events * @current_evet: current processing firmware event @@ -1351,7 +1350,6 @@ struct MPT3SAS_ADAPTER { struct delayed_work fault_reset_work; /* fw event handler */ - char firmware_event_name[20]; struct workqueue_struct *firmware_event_thread; spinlock_t fw_event_lock; struct list_head fw_event_list; diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 97c2472cd434..728cced42b0e 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -12301,10 +12301,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); /* event thread */ - snprintf(ioc->firmware_event_name, sizeof(ioc->firmware_event_name), - "fw_event_%s%d", ioc->driver_name, ioc->id); ioc->firmware_event_thread = alloc_ordered_workqueue( - ioc->firmware_event_name, 0); + "fw_event_%s%d", 0, ioc->driver_name, ioc->id); if (!ioc->firmware_event_thread) { ioc_err(ioc, "failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); From patchwork Thu Aug 22 19:59:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821610 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4BA81D0498 for ; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356823; cv=none; b=FPkWNwOStrzv1AaEednQBGtJbDmKxIJtRJB1ToR8krsKpXVEaUSCJzi5trtqkDS/VwIQzR8jiPjbyP4ma67eGNHM7aeUYlrq1NEPDXqb+YZQme0qAjBWwlQ39IJeiKSwrnUK3T/E/zP0ZC/vDNt1q0neOr2OPNx6/v7/WFOZykw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356823; c=relaxed/simple; bh=pKoaZ+AWdHtH3ENZvSwQNYVhA6qLwmMRi6N1YCz+V5M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a+EOw7WujmpQ73YjyUjeOWyhibIWW5H+IWURhOgsyrgsWnsSvVrGGCI5Y2YnAu+BJRYLcxZQgWBPiQHwvhwImQ5vcBP4dWisrBSDurK73jm0Jdr+PqfVWheFbn8/Upbu4driqEYLwTeRhEUyDq5pVpSF6nuoHJwNMlElueQM5V8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=TDxpJWZL; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="TDxpJWZL" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw52FSWz6ClY9T; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356818; x=1726948819; bh=grUuH VtYtG0vOU6ssbFXaGw2TolOmql3pZyaX7x0xbQ=; b=TDxpJWZLs3J+vc/6BBQ9k 0u6bCg7KF35H372BBUKRuGQDPfbP3aImeCn4G/t/LChz8h3ANCRIwG25me3rnEt7 V4u6OWEHL7RetmhIufDhQh0tu+QWOBUF18F1Wc+1F8xFdDzB3aTQTx1OyHfzcuxU +WQ8q0EfXpp2zo2bfwRurG/0C/HZ4wyXTkluQDgsszqtZMG8KEz6KI54ffdgIxWm /uZaB36PbN5HX72ld6/WNbIlhNpHtVmdozTADvvH/JiDgPDUsKi2+hGzy/5eMs0X H7vMykiiQ8bRixmwOqbkExzJ3p2mgLR5C9IJRK/RrS1ftwsJPBKSFipYM6QsBSWM g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 9bef0GZHEQxM; Thu, 22 Aug 2024 20:00:18 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw20YHsz6ClY9K; Thu, 22 Aug 2024 20:00:17 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , Hannes Reinecke , "James E.J. Bottomley" Subject: [PATCH v3 10/18] scsi: myrb: Simplify an alloc_ordered_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:14 -0700 Message-ID: <20240822195944.654691-11-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/scsi/myrb.c | 6 ++---- drivers/scsi/myrb.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c index 140dc0e9cead..bfc2b835e612 100644 --- a/drivers/scsi/myrb.c +++ b/drivers/scsi/myrb.c @@ -112,10 +112,8 @@ static bool myrb_create_mempools(struct pci_dev *pdev, struct myrb_hba *cb) return false; } - snprintf(cb->work_q_name, sizeof(cb->work_q_name), - "myrb_wq_%d", cb->host->host_no); - cb->work_q = - alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, cb->work_q_name); + cb->work_q = alloc_ordered_workqueue("myrb_wq_%d", WQ_MEM_RECLAIM, + cb->host->host_no); if (!cb->work_q) { dma_pool_destroy(cb->dcdb_pool); cb->dcdb_pool = NULL; diff --git a/drivers/scsi/myrb.h b/drivers/scsi/myrb.h index fb8eacfceee8..78dc4136fb10 100644 --- a/drivers/scsi/myrb.h +++ b/drivers/scsi/myrb.h @@ -712,7 +712,6 @@ struct myrb_hba { struct Scsi_Host *host; struct workqueue_struct *work_q; - char work_q_name[20]; struct delayed_work monitor_work; unsigned long primary_monitor_time; unsigned long secondary_monitor_time; From patchwork Thu Aug 22 19:59:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822110 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0211B1D0DC0 for ; Thu, 22 Aug 2024 20:00:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356826; cv=none; b=Pz0tlE8dN/6KwQSeFANinGsEXfapJSZ/q5TAOPNUEAm4AItsTRQq2iwiR8DA6QX/nBQH3mlQnyIPFLtYtXJMD5GYsI3uiRJSIV+k7wm8AQQRQEG+vu2RxevrPhnzU0cijwP4yquqQ3k05dvc6udNv8xopiXffUtZ/OWHx/SCZ1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356826; c=relaxed/simple; bh=ILSVpTz5PpXWddwJQr5xWOBWbKeXj2zOpyoIuIBN3Os=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iZltj3FMywLowdKWbwH1SmrFWI8a7h7AXVwaBh1XKJCNiSo/ULGbG2UTtIWOXsGIip2eBjYVdc+x/K1ntSgSEinQP6GwbxP8J/7Eb7rCnS+ZrbQK1ZJ9LiXsy28shsY6yt2euJ52bvNgi5aRFBYYypoQ/PvLHodHhxZJ59BriAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=eOxFnP5M; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="eOxFnP5M" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw61kJnz6ClY9R; Thu, 22 Aug 2024 20:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356819; x=1726948820; bh=zFCfV ZLZz8yi36LVVhvfZgNT0zp7fTxTj5SMahBW1dQ=; b=eOxFnP5MTe2r1+AprgBH+ ksF+UQ0kkywPMONXupw9ln7zUFQv2bpodbSwlA1O2vwbNjt51k7dSTdqrnB8xetO mn/OS2Vt0Is5WiHSeNKO2eCnkJQYb/G2XTmz76OJv3bmDiGPo+RIb/XkXnpCZD5V Cs0Z+FZwwHl/bmZZULN8ulgUofuIhJYA6HxgewaG3h1Vm3N9SAiYqpMfJfxkRE8u HJS9U0OK3xpSu+Czr9PWS9UZExbYN8mqRk3Q1gdhRewa6pLk5GZ5Zgytl6qLeGzN HfOL/Ct2iFK+IspuoT+rSWwQWZIEeidjvsbeAfCCVKdg1ojYM+KQcZSTWXqnxbGS w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id C3AmXP1C9-fm; Thu, 22 Aug 2024 20:00:19 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw26dbgz6ClY9Q; Thu, 22 Aug 2024 20:00:18 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , Hannes Reinecke , "James E.J. Bottomley" Subject: [PATCH v3 11/18] scsi: myrs: Simplify an alloc_ordered_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:15 -0700 Message-ID: <20240822195944.654691-12-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche --- drivers/scsi/myrs.c | 6 ++---- drivers/scsi/myrs.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index 8a8f26633cda..3392feb15cb4 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -2206,10 +2206,8 @@ static bool myrs_create_mempools(struct pci_dev *pdev, struct myrs_hba *cs) return false; } - snprintf(cs->work_q_name, sizeof(cs->work_q_name), - "myrs_wq_%d", shost->host_no); - cs->work_q = - alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, cs->work_q_name); + cs->work_q = alloc_ordered_workqueue("myrs_wq_%d", WQ_MEM_RECLAIM, + shost->host_no); if (!cs->work_q) { dma_pool_destroy(cs->dcdb_pool); cs->dcdb_pool = NULL; diff --git a/drivers/scsi/myrs.h b/drivers/scsi/myrs.h index 9f6696d0ddd5..e1d6b123de7b 100644 --- a/drivers/scsi/myrs.h +++ b/drivers/scsi/myrs.h @@ -904,7 +904,6 @@ struct myrs_hba { bool disable_enc_msg; struct workqueue_struct *work_q; - char work_q_name[20]; struct delayed_work monitor_work; unsigned long primary_monitor_time; unsigned long secondary_monitor_time; From patchwork Thu Aug 22 19:59:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821608 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 760C81D0DF2 for ; Thu, 22 Aug 2024 20:00:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356826; cv=none; b=qNwhYNl85z4DBvE539d+keTiwdcTY3xbHLukaBAmn9jgfK0zTt06zID4E6YKQMt4SHLiCpsF4CVxHk6i8AopmJA5D9O1EiF8kmfocCglqGe1fE1M4W/BC1aFBfn/I/IGhE5Juxg+1kja+sIMcAEbzhwI3ob/1+2rnBLPfYJnwnE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356826; c=relaxed/simple; bh=QAQmSHyA1htKOCOTLofJhDkKV1bLR1ebEZ2/7d1S45s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pyjef6YZQI9sFWI6oBkabsTcB26IJUljPOzNSCNO7d4Kdljq9lcCcSsvjmS5hyrtRqpGcyWtzn5botr/h1oVBAfFxuIjCUBL+oCwGvI7CZtxQEZZLK2GO+C9Ec4aml1NpkVxgec2SwsC7LxbOUxBYrdu1jncv/I9avanPz6GMdM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=2cHYql16; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="2cHYql16" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw76s2Bz6ClY9V; Thu, 22 Aug 2024 20:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356820; x=1726948821; bh=0UxNS A4jrVK2mhDYHg/pl/5CjI4bZK3kZt5XmoH7sWc=; b=2cHYql16KovKz9cwsw3eV yCIMiCDgeQ+5y2HwnXPvo0ZkyPTbB0putbcqu8Gn7rVjq0sbBikuTBrXIPawq/c1 zS0jT2OwDbCBTnDR3Tmi2Ko6qVPnwTEdKpYojBRmtPNvJ3G/yikS+RNZluMVJ7pC VJsazHcI3vcmS9GfJBBnKX88dRNHhdCAHpvTgooHrije8qmSFIasDXgycjCTa7tb WNiVjJ3UjvI+jL3xvH93L4u0z3zfS6GBehgk3QIOvYShSflXdeaFvSFyLJM+fdh0 r49qS1okqQm+nB7SqmIPr0m+RV8aVxtfi7zT4qGbfwrJ7yea/n73d28dKhjDEga+ Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id cqEF-bqrj0FE; Thu, 22 Aug 2024 20:00:20 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw357blz6ClY9N; Thu, 22 Aug 2024 20:00:19 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Saurav Kashyap , Javed Hasan , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 12/18] scsi: qedf: Simplify alloc_workqueue() invocations Date: Thu, 22 Aug 2024 12:59:16 -0700 Message-ID: <20240822195944.654691-13-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/qedf/qedf_main.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 119afcaf6e13..cf13148ba281 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -3372,10 +3372,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_INFO, "qedf->io_mempool=%p.\n", qedf->io_mempool); - sprintf(host_buf, "qedf_%u_link", - qedf->lport->host->host_no); - qedf->link_update_wq = - alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); + qedf->link_update_wq = alloc_workqueue("qedf_%u_link", WQ_MEM_RECLAIM, + 1, qedf->lport->host->host_no); INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update); INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery); INIT_DELAYED_WORK(&qedf->grcdump_work, qedf_wq_grcdump); @@ -3585,8 +3583,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) ether_addr_copy(params.ll2_mac_address, qedf->mac); /* Start LL2 processing thread */ - snprintf(host_buf, 20, "qedf_%d_ll2", host->host_no); - qedf->ll2_recv_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); + qedf->ll2_recv_wq = alloc_workqueue("qedf_%d_ll2", WQ_MEM_RECLAIM, 1, + host->host_no); if (!qedf->ll2_recv_wq) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to LL2 workqueue.\n"); rc = -ENOMEM; @@ -3627,9 +3625,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) } } - sprintf(host_buf, "qedf_%u_timer", qedf->lport->host->host_no); - qedf->timer_work_queue = - alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); + qedf->timer_work_queue = alloc_workqueue("qedf_%u_timer", + WQ_MEM_RECLAIM, 1, qedf->lport->host->host_no); if (!qedf->timer_work_queue) { QEDF_ERR(&(qedf->dbg_ctx), "Failed to start timer " "workqueue.\n"); From patchwork Thu Aug 22 19:59:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822109 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A99A71D0DF7 for ; Thu, 22 Aug 2024 20:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356827; cv=none; b=HZVwDwddJ3Jvqbz7mskUFOM/JZnHe4lWH/P/e2QFAGHF1OtM9/C3LR+8iOmtZDD88PIyNzXv/b79UzePSyRjV1x8Y0V2AHdVOoGQnlIiwSnFRDRwr/YeJWZRV9YfA+yjW5VvFP/fpYIKWs5MccaAmJxoCjODpEAmbVkiT4ofBR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356827; c=relaxed/simple; bh=7nGf1avZ8XzYh4Jo/5xXziYrWN4ZpJANrQpBr0PjxYU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Eh93goo5XMRUx7397DZt0SwPF5hrVrmCt9drGQ3VAb3qi4RKjV+/sxFq9dcPCft7Ru7pHUecnPyGg5jZZ0Q+yq8blgdL/TJADB2/MP8tpH2mEpMUDLPedNFEr5WE2cC8mgkGWJ8FaqbOURgrOXd0RZsKQ9uzSO+aBBeleDvF1zI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=G2e7nfqG; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="G2e7nfqG" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw80ZDXz6ClY9N; Thu, 22 Aug 2024 20:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356821; x=1726948822; bh=FvyvV epn9Ef318j/BW4eY2hkqG5sJ6CUqIzNn60Mg04=; b=G2e7nfqGdeMUgjP+oRjQd M86yAjHD+Ag3zVeaet/ny2/Ye3fLQxVznzF9a4JAEp4FBDb7VJQW/QeRwTvqG9Oa BcLglpoVb6CN0RV82K8IIpI3PTxhp2e2skQwAcmET7Dfy/dfA+fdjwdg8v5+n0eL eM2BbrTPSG5yF21hB/kAUSiwUCiAElGhXBZrE4I8/PwT8+kRc9gNBN3GBBKWDbUI stqeG7nZJTJ+5ilomyKKGGYpw5bS5So70EUdPGM46PWpBpjHlXH8BE2tZL429XOa 7wit3dD8CUqOb6jW1zFJyRB9L+uv1WP0tlMiajGDbdfxwSBdYZeBcOy1ZlIsRzPl g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id iS9m3i3WyYoG; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw44G6Mz6ClY9S; Thu, 22 Aug 2024 20:00:20 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 13/18] scsi: qedi: Simplify an alloc_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:17 -0700 Message-ID: <20240822195944.654691-14-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/qedi/qedi_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index 319c1da549f7..c5aec26019d6 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -2776,9 +2776,9 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) goto free_cid_que; } - sprintf(host_buf, "qedi_ofld%d", qedi->shost->host_no); - qedi->offload_thread = - alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf); + qedi->offload_thread = alloc_workqueue("qedi_ofld%d", + WQ_MEM_RECLAIM, + 1, qedi->shost->host_no); if (!qedi->offload_thread) { QEDI_ERR(&qedi->dbg_ctx, "Unable to start offload thread!\n"); From patchwork Thu Aug 22 19:59:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821607 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48D101F957 for ; Thu, 22 Aug 2024 20:00:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356828; cv=none; b=gu5LprPMfnJLn1z20b6TjNp5zYx92GZq1OlGEooxwNPr1g4GLd9iQDMYqX5MvqWjIo4HcS7sp3juCOO8RtM8sOBniwMg/JwZU4XCEKoIYDk5T0RCrnKg9yLAV36T/UtboMpgxrvpDRLMVB9Xv2o6UO30VMMzR4ivvrVCV65FBAM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356828; c=relaxed/simple; bh=pA2mwES7jKXuzQMVYFJHvSelSQqGZ4r9W25lBSNyhOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H0yGx53xoPpIBAdZcQ33Vkl+KMdaIxeIu6glnlU2wEnaHeL1MPDhdeGJA2Ut/sDOx3vJuazZg8qht/owK0qtE+IsgHf7bQUX/zkNh3jskcFsbCWMvJFrreWe0DtjqzgovFf5ZO1w4icSFmXLUV0lzaxUsym5mbblCA4sjBpasic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=meDipUd3; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="meDipUd3" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw85tyqz6ClY9S; Thu, 22 Aug 2024 20:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356821; x=1726948822; bh=1N94F XqRhqtlmPV6jIRH5+cvoqssL2AufpN0BOyUzc4=; b=meDipUd38ZNdqfMurxYCk NjVTS2vhIf/1rzMWjAH3qtqSvdYC8V/xl1bZa0ao/PfgDw1jLEnX9QGp3qJ1i8YN +Ragu96roaATSF6GSq/JJFVdojdBJ0sn+Rp43Wex5YdZuoTjtNyB0gf5GWC+eMko iqud32gK/VYGyEyaNlAwHasMfpvGqrOB2yRwakhWmcr6TIcPuyRtlc4sqlTGg5YR Fh2rs00cHgN2NGrEQAtWZ1QviAxQsug7yJW4JI046X5Cwy+aWjq7qie1/vYO40Ic FnbKRevdzrCyP63hXqyxCs4UxWo2g7FCCaqhoexoYRc4iVMOsHgtwBuokm0TSkyR g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id xYnbK0M7J9L9; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw53PgRz6ClY9K; Thu, 22 Aug 2024 20:00:21 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Karan Tilak Kumar , Sesidhar Baddela , "James E.J. Bottomley" Subject: [PATCH v3 14/18] scsi: snic: Simplify alloc_workqueue() invocations Date: Thu, 22 Aug 2024 12:59:18 -0700 Message-ID: <20240822195944.654691-15-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_workqueue() format the workqueue name instead of calling snprintf() explicitly. Not setting shost->work_q_name is safe because there is no code that reads the value set by the removed code. Signed-off-by: Bart Van Assche --- drivers/scsi/snic/snic_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c index 79ffcf796b05..9be3f0193145 100644 --- a/drivers/scsi/snic/snic_main.c +++ b/drivers/scsi/snic/snic_main.c @@ -300,10 +300,8 @@ snic_add_host(struct Scsi_Host *shost, struct pci_dev *pdev) } SNIC_BUG_ON(shost->work_q != NULL); - snprintf(shost->work_q_name, sizeof(shost->work_q_name), "scsi_wq_%d", - shost->host_no); - shost->work_q = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, - shost->work_q_name); + shost->work_q = alloc_ordered_workqueue("scsi_wq_%d", WQ_MEM_RECLAIM, + shost->host_no); if (!shost->work_q) { SNIC_HOST_ERR(shost, "Failed to Create ScsiHost wq.\n"); From patchwork Thu Aug 22 19:59:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821606 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E72FF1D172B for ; Thu, 22 Aug 2024 20:00:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356830; cv=none; b=sNl4GMdMh/IW61yKFDnXn4iRghfsPRmYD4Dfzz2RAzqQgtTY5LHg5VXEyJPl4GCEaUWaWKDUwDxxy01ozNRdCUL1r+4NjBTMnPJRfMF4BoQWF788DZrj+Ix3/jSqm4tM3DR7nGoMAuCulT6UAdcBDmQttHSWi37zS25BQ1ojqAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356830; c=relaxed/simple; bh=3k4ojss9UB7ndHPbNW1ez+COSFbfUAE8I1Pvuiq2pjo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rAQKlne1sd7mT8ZCYwUcQTTyoLvgTdImoP5ACBDcSXozMUncmUd3wGxxwGfbvFwLcrJs1oiY4KSCs/jtQcWaxtXwpQYzbfP8AHdezTRfo8Yy3jY5difkVPa15xjMm8eQruxIKjucacFbFAWvY/k0lcYPs+8ys0zeLPLngoNHh6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=ZvXu5hXw; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="ZvXu5hXw" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw92P06z6ClY9M; Thu, 22 Aug 2024 20:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356822; x=1726948823; bh=/E5GT rDEaVP02Hizwx6adZbgC16BvVgdfuw5s3s7RX8=; b=ZvXu5hXwalZzvwzCh4Z7x b1i6GzNO4/UltNIrPpVBJZUty03/y/F19yPUxK++dk8onf9KfwbkxK+LC9iylCVY 27FzMqbhxTsfAJKnxKVo1MLdWLT4M5umhCfU7NzMLLgA+6hO3GZkxV0f6G/ieIC4 /5Wh5qetAwj7Y1ZEyPT11F/PU0x3XjsdTafWvgLDlY7Im3ViMjfhioGkpjCMNMEx 3WZ9JiXTaNSfC8EiIx2xzLaJqfJ7WnZJBOwohvQLlYlCTK9DGvJJP2E+FoOIZoHp JP3ghpTD6rO4cXQkwke+3+CbLxygZCG3rbdzhO1zXfpoghbmeBuH+EIsGgQwX7t0 Q== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id Njtmct7FwcTC; Thu, 22 Aug 2024 20:00:22 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw62DSjz6ClY9P; Thu, 22 Aug 2024 20:00:22 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH v3 15/18] scsi: scsi_transport_fc: Simplify alloc_workqueue() invocations Date: Thu, 22 Aug 2024 12:59:19 -0700 Message-ID: <20240822195944.654691-16-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_transport_fc.c | 11 +++-------- include/scsi/scsi_transport_fc.h | 6 ------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 7d088b8da075..62ea7e44460e 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -441,18 +441,13 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev, fc_host->next_vport_number = 0; fc_host->npiv_vports_inuse = 0; - snprintf(fc_host->work_q_name, sizeof(fc_host->work_q_name), - "fc_wq_%d", shost->host_no); - fc_host->work_q = alloc_workqueue("%s", 0, 0, fc_host->work_q_name); + fc_host->work_q = alloc_workqueue("fc_wq_%d", 0, 0, shost->host_no); if (!fc_host->work_q) return -ENOMEM; fc_host->dev_loss_tmo = fc_dev_loss_tmo; - snprintf(fc_host->devloss_work_q_name, - sizeof(fc_host->devloss_work_q_name), - "fc_dl_%d", shost->host_no); - fc_host->devloss_work_q = alloc_workqueue("%s", 0, 0, - fc_host->devloss_work_q_name); + fc_host->devloss_work_q = alloc_workqueue("fc_dl_%d", 0, 0, + shost->host_no); if (!fc_host->devloss_work_q) { destroy_workqueue(fc_host->work_q); fc_host->work_q = NULL; diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 4b884b8013e0..8e6c60090c62 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h @@ -575,9 +575,7 @@ struct fc_host_attrs { u16 npiv_vports_inuse; /* work queues for rport state manipulation */ - char work_q_name[20]; struct workqueue_struct *work_q; - char devloss_work_q_name[20]; struct workqueue_struct *devloss_work_q; /* bsg support */ @@ -654,12 +652,8 @@ struct fc_host_attrs { (((struct fc_host_attrs *)(x)->shost_data)->next_vport_number) #define fc_host_npiv_vports_inuse(x) \ (((struct fc_host_attrs *)(x)->shost_data)->npiv_vports_inuse) -#define fc_host_work_q_name(x) \ - (((struct fc_host_attrs *)(x)->shost_data)->work_q_name) #define fc_host_work_q(x) \ (((struct fc_host_attrs *)(x)->shost_data)->work_q) -#define fc_host_devloss_work_q_name(x) \ - (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name) #define fc_host_devloss_work_q(x) \ (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) #define fc_host_dev_loss_tmo(x) \ From patchwork Thu Aug 22 19:59:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822108 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41FBE1D0DE3 for ; Thu, 22 Aug 2024 20:00:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356829; cv=none; b=Ee6w/fxCEgC6pRey9rYGbKC2eYf8qW+lR51dOcp+RpCCw0+uhoTq/JRWqZK5GXfZp1Rh7zpLxfOlEzcX853qtQu2T8MTbDosgkYyY5qj2DS5Mxc1CqO7VUwoW/vuIsnF/y6YQRuwR9H8nLKFEu9GsDtDhyqD6EEthgt4hvdZPeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356829; c=relaxed/simple; bh=R8HumJBM8ZU/AKzLjESjdXJq5h4uLvaVuxrkBFXonYo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JKplyiAF2kx31Fz+GdF8tG8CnxOYYjdbzXo2tj4nyzgA7l8mt0raF1XgzLNhJy7vx3NIm+l1W+odlFJXQyGMZjTssiCE8EXdYbtfy+ZTZSsSYf+qzhnKc6HUSKVONe8ZiEskQ0UnK67qUiOy455WWDKd2LGI9/VBrXkc2xbcbHo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=TODsb/Lq; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="TODsb/Lq" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYw91fM3z6ClY9K; Thu, 22 Aug 2024 20:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356823; x=1726948824; bh=NUMwq 9m0NGA/JPJnvjiSkyJiugCR5QZ35pSWfTHWtKw=; b=TODsb/LqPJ+U+HWT/+Jub pWPM9vRTUnRTeHTiGG94sZQoeYY8ganHmqHr/Af8pjF90HHAIA0fw3mT8++piUDy DqooJ0aAPnmvQjAB8HWqp5Mlh2DU6XI8WaF5gqVEQc7DkFxgPVRlxYaV4dov3asw +zkTrZhBD0QzFJszWHT1aBb+4QyQYtZli/wiBk/04+/8uBucfqA15jxFrZEsOhPB YWJxOWQva/0qPhWcA5yTvdVNRU+mP0u9IrMH+95LXpxuxwhSXgUHBV64IrwDCQsN +zgODqIvLOCN0H1tDIAVtpzY8Io/FWrv2aaEIj/JVN4dEfeAEiRIpSH9ZCTJWMvC A== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id q58s3-N3F8qI; Thu, 22 Aug 2024 20:00:23 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYw66Zmtz6ClY9Q; Thu, 22 Aug 2024 20:00:22 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH v3 16/18] scsi: stex: Simplify an alloc_ordered_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:20 -0700 Message-ID: <20240822195944.654691-17-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_ordered_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche --- drivers/scsi/stex.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index fbee7db4a835..0e81125df8c7 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -334,7 +334,6 @@ struct st_hba { struct st_ccb *wait_ccb; __le32 *scratch; - char work_q_name[20]; struct workqueue_struct *work_q; struct work_struct reset_work; wait_queue_head_t reset_waitq; @@ -1795,10 +1794,8 @@ static int stex_probe(struct pci_dev *pdev, const struct pci_device_id *id) hba->pdev = pdev; init_waitqueue_head(&hba->reset_waitq); - snprintf(hba->work_q_name, sizeof(hba->work_q_name), - "stex_wq_%d", host->host_no); - hba->work_q = - alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, hba->work_q_name); + hba->work_q = alloc_ordered_workqueue("stex_wq_%d", WQ_MEM_RECLAIM, + host->host_no); if (!hba->work_q) { printk(KERN_ERR DRV_NAME "(%s): create workqueue failed\n", pci_name(pdev)); From patchwork Thu Aug 22 19:59:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 821605 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFD2D13AA4E for ; Thu, 22 Aug 2024 20:00:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356836; cv=none; b=Thrmb5cIPA8fwzCw9Cl/bfOXf3cnjVWqgIVZn6jB6Dkq/BdcF/sgcSexNg4MSZGIfl7O+3jaIfdVZ4to30o9Nij4gcnwZeo9YFB77TyWZdKo/ITRAd2CMdd/31BonFPiP7Mve1xoGSXn0IVEoYYAjVq3wq9I+tjllxOeuyGmkqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356836; c=relaxed/simple; bh=OXtnHsx14vrlA8yUoDAw4bvMVRD349ZIRskqcSnCkew=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F0xzvEC8nhBVgFu/WmvWLrIh9NMBla34K+H4NUWBzHMWSRXOczbjErIdeuSs2yajgC7wD0cfwyvHpxTTe4Hpamx/3W42TpeM5D2Z9GmFJ9Lxpd9fEOqptcRLXgMGDoSw4NeynzQjLXoid8faclW/WWgAznhQfo0slzo4yUKV4AY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=dgx6N/EC; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="dgx6N/EC" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYwL56Qgz6ClY9K; Thu, 22 Aug 2024 20:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356828; x=1726948829; bh=WtPiN dwGiioFIODzHvIxB4aENqsjb99zdQo7b/4Ezfc=; b=dgx6N/ECAolaJU0sZuxQ+ aKySr4jQhbdzZyj5EYnFkWlMhp8+/9wJT526s3llzhT50hjXSgE4BPWXDzn+J7f0 iF9ZWkio2eLogY3hKC0W8L0csgsN79zrOeE++9gqVe4CPj3EmMAiqD9d3AnNVRHq y9bKZic1gikBwHnA0rwmXZrCds6uMh8LAZPbmiy0iair2CmxHIwfW49Yafwmcs/K HzEv8cJAFQBlq9jsDMYBhCtkysyZtq/D4DvDh0E6ISp+Mk5gVOdbjJhIn1Tkfmj2 bwuKl1fGAy26BEB3zXTo2dX553Ll/rAiwdHucz7XSyRjnDSkrGyGjWfbdjWeWSW6 w== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id M2JMgyjlr1qY; Thu, 22 Aug 2024 20:00:28 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYwC1nZvz6ClY9P; Thu, 22 Aug 2024 20:00:27 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Manivannan Sadhasivam , Peter Wang , "James E.J. Bottomley" , Matthias Brugger , AngeloGioacchino Del Regno , Avri Altman , Bean Huo , Andrew Halaney Subject: [PATCH v3 17/18] scsi: ufs: Simplify alloc*_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:21 -0700 Message-ID: <20240822195944.654691-18-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc*_workqueue() format the workqueue name instead of calling snprintf() explicitly. Reviewed-by: Manivannan Sadhasivam Reviewed-by: Peter Wang Signed-off-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index bc00603a6837..f3a50517d691 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -1804,8 +1804,6 @@ static void ufshcd_remove_clk_scaling_sysfs(struct ufs_hba *hba) static void ufshcd_init_clk_scaling(struct ufs_hba *hba) { - char wq_name[sizeof("ufs_clkscaling_00")]; - if (!ufshcd_is_clkscaling_supported(hba)) return; @@ -1817,10 +1815,8 @@ static void ufshcd_init_clk_scaling(struct ufs_hba *hba) INIT_WORK(&hba->clk_scaling.resume_work, ufshcd_clk_scaling_resume_work); - snprintf(wq_name, sizeof(wq_name), "ufs_clkscaling_%d", - hba->host->host_no); - hba->clk_scaling.workq = - alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, wq_name); + hba->clk_scaling.workq = alloc_ordered_workqueue( + "ufs_clkscaling_%d", WQ_MEM_RECLAIM, hba->host->host_no); hba->clk_scaling.is_initialized = true; } @@ -2144,8 +2140,6 @@ static void ufshcd_remove_clk_gating_sysfs(struct ufs_hba *hba) static void ufshcd_init_clk_gating(struct ufs_hba *hba) { - char wq_name[sizeof("ufs_clk_gating_00")]; - if (!ufshcd_is_clkgating_allowed(hba)) return; @@ -2155,10 +2149,9 @@ static void ufshcd_init_clk_gating(struct ufs_hba *hba) INIT_DELAYED_WORK(&hba->clk_gating.gate_work, ufshcd_gate_work); INIT_WORK(&hba->clk_gating.ungate_work, ufshcd_ungate_work); - snprintf(wq_name, ARRAY_SIZE(wq_name), "ufs_clk_gating_%d", - hba->host->host_no); - hba->clk_gating.clk_gating_workq = alloc_ordered_workqueue(wq_name, - WQ_MEM_RECLAIM | WQ_HIGHPRI); + hba->clk_gating.clk_gating_workq = alloc_ordered_workqueue( + "ufs_clk_gating_%d", WQ_MEM_RECLAIM | WQ_HIGHPRI, + hba->host->host_no); ufshcd_init_clk_gating_sysfs(hba); @@ -10395,7 +10388,6 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) int err; struct Scsi_Host *host = hba->host; struct device *dev = hba->dev; - char eh_wq_name[sizeof("ufs_eh_wq_00")]; /* * dev_set_drvdata() must be called before any callbacks are registered @@ -10462,9 +10454,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) hba->max_pwr_info.is_valid = false; /* Initialize work queues */ - snprintf(eh_wq_name, sizeof(eh_wq_name), "ufs_eh_wq_%d", - hba->host->host_no); - hba->eh_wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, eh_wq_name); + hba->eh_wq = alloc_ordered_workqueue("ufs_eh_wq_%d", WQ_MEM_RECLAIM, + hba->host->host_no); if (!hba->eh_wq) { dev_err(hba->dev, "%s: failed to create eh workqueue\n", __func__); From patchwork Thu Aug 22 19:59:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 822107 Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 249A41D172B for ; Thu, 22 Aug 2024 20:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356832; cv=none; b=iY6zHJD5Fo6DiskNYYIvaA/fPtPwUgd8d7rHxqik+MYr88JWvcyxN5VF/9CoTcGUITNN4T3FVcmokhQWe8nwasca1Ucrhk/f5T6k65Djg48rsCe92Sn0GdDpdm2O9PiYFnpfvzNbaexyQxAFzAfjx9ozlJCZDopOmuN1SDJyy7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724356832; c=relaxed/simple; bh=7kjn2PW0edxLbmi5bDpNtu70kfZrIQkHqINd9nrsch8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PeUOky0GCieUI4Qn67qLvW1oqRLC7SR6eWdJakj+yH+dPfq5MCXALjkMtuaKlunI3bjvYsp1JQs7zCRjADpkIUSj3uekdRIZndJLlnbYIpvofGf3MgYdPTUA5vH6oRC0DDPBQ2HdifyBhhyN5dORKn0uiff0tq70VFI5glsCH7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=t5/gSG2+; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="t5/gSG2+" Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4WqYwG6MJcz6ClY9N; Thu, 22 Aug 2024 20:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=mr01; t=1724356828; x=1726948829; bh=YAW7x A5GODRbTNzhiwNiFkH85DSCsHxdn6HxMQMRV2g=; b=t5/gSG2+l5NqaXZ4O+tOa 0LeWJvn2V8pIUdMd2IAnFrzUtwetDJxJaCZ1qQTcvnoYiaNrtgb391nOzVYw8Bhi 7cQ7onBBcTKIw1vpb5tOMMLqE21zKgLizckK+qKMcDBRyEJiQFZBR4R2bf0uMziN 8jouSwKS1JLH6jCJdPjfclYm997HWt+o3t0wpSnGKHscBd/dghZ0nXrgqAZ2LfR2 wUBJbJc63EwygH+qna+t8qXSHTMJNgj5/yghUSx1u4fFNcks3FUoG/EevCgEpQo4 Sl7exxnRsn4qIsttTD9+GeMHYCDXDERluJ7v1hIZkCGu9Cp0e8kgKYgoI28cn/4U g== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id RMfO8RRBgGyS; Thu, 22 Aug 2024 20:00:28 +0000 (UTC) Received: from bvanassche.mtv.corp.google.com (unknown [104.135.204.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4WqYwD3qyKz6ClY9L; Thu, 22 Aug 2024 20:00:28 +0000 (UTC) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH v3 18/18] scsi: core: Simplify an alloc_workqueue() invocation Date: Thu, 22 Aug 2024 12:59:22 -0700 Message-ID: <20240822195944.654691-19-bvanassche@acm.org> X-Mailer: git-send-email 2.46.0.295.g3b9ea8a38a-goog In-Reply-To: <20240822195944.654691-1-bvanassche@acm.org> References: <20240822195944.654691-1-bvanassche@acm.org> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Let alloc_workqueue() format the workqueue name. Remove the work_q_name[] member from struct Scsi_Host because it is no longer used by any SCSI driver nor by the SCSI core. Signed-off-by: Bart Van Assche --- drivers/scsi/hosts.c | 9 ++++----- include/scsi/scsi_host.h | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 7f987335b44c..e021f1106bea 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -292,11 +292,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, } if (shost->transportt->create_work_queue) { - snprintf(shost->work_q_name, sizeof(shost->work_q_name), - "scsi_wq_%d", shost->host_no); - shost->work_q = alloc_workqueue("%s", - WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, - 1, shost->work_q_name); + shost->work_q = alloc_workqueue( + "scsi_wq_%d", + WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, 1, + shost->host_no); if (!shost->work_q) { error = -EINVAL; diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 19a1c5c48935..2b4ab0369ffb 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -677,7 +677,6 @@ struct Scsi_Host { /* * Optional work queue to be utilized by the transport */ - char work_q_name[20]; struct workqueue_struct *work_q; /*