Skip to content

Commit 8bbe60b

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: qedf: Simplify alloc_workqueue() invocations
Let alloc_workqueue() format the workqueue name instead of calling snprintf() explicitly. Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f306791 commit 8bbe60b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/scsi/qedf/qedf_main.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3372,10 +3372,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
33723372
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_INFO, "qedf->io_mempool=%p.\n",
33733373
qedf->io_mempool);
33743374

3375-
sprintf(host_buf, "qedf_%u_link",
3376-
qedf->lport->host->host_no);
3377-
qedf->link_update_wq =
3378-
alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
3375+
qedf->link_update_wq = alloc_workqueue("qedf_%u_link", WQ_MEM_RECLAIM,
3376+
1, qedf->lport->host->host_no);
33793377
INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update);
33803378
INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery);
33813379
INIT_DELAYED_WORK(&qedf->grcdump_work, qedf_wq_grcdump);
@@ -3585,8 +3583,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
35853583
ether_addr_copy(params.ll2_mac_address, qedf->mac);
35863584

35873585
/* Start LL2 processing thread */
3588-
snprintf(host_buf, 20, "qedf_%d_ll2", host->host_no);
3589-
qedf->ll2_recv_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
3586+
qedf->ll2_recv_wq = alloc_workqueue("qedf_%d_ll2", WQ_MEM_RECLAIM, 1,
3587+
host->host_no);
35903588
if (!qedf->ll2_recv_wq) {
35913589
QEDF_ERR(&(qedf->dbg_ctx), "Failed to LL2 workqueue.\n");
35923590
rc = -ENOMEM;
@@ -3627,9 +3625,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
36273625
}
36283626
}
36293627

3630-
sprintf(host_buf, "qedf_%u_timer", qedf->lport->host->host_no);
3631-
qedf->timer_work_queue =
3632-
alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, host_buf);
3628+
qedf->timer_work_queue = alloc_workqueue("qedf_%u_timer",
3629+
WQ_MEM_RECLAIM, 1, qedf->lport->host->host_no);
36333630
if (!qedf->timer_work_queue) {
36343631
QEDF_ERR(&(qedf->dbg_ctx), "Failed to start timer "
36353632
"workqueue.\n");

0 commit comments

Comments
 (0)