Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: mptfusion: Simplify the alloc*_workqueue() invocations

Let alloc*_workqueue() format the workqueue names instead of calling
snprintf() explicitly.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240822195944.654691-3-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
dec52397 b97c0741

+5 -15
+3 -7
drivers/message/fusion/mptbase.c
··· 1856 1856 /* Initialize workqueue */ 1857 1857 INIT_DELAYED_WORK(&ioc->fault_reset_work, mpt_fault_reset_work); 1858 1858 1859 - snprintf(ioc->reset_work_q_name, MPT_KOBJ_NAME_LEN, 1860 - "mpt_poll_%d", ioc->id); 1861 - ioc->reset_work_q = alloc_workqueue(ioc->reset_work_q_name, 1862 - WQ_MEM_RECLAIM, 0); 1859 + ioc->reset_work_q = 1860 + alloc_workqueue("mpt_poll_%d", WQ_MEM_RECLAIM, 0, ioc->id); 1863 1861 if (!ioc->reset_work_q) { 1864 1862 printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n", 1865 1863 ioc->name); ··· 1984 1986 1985 1987 INIT_LIST_HEAD(&ioc->fw_event_list); 1986 1988 spin_lock_init(&ioc->fw_event_lock); 1987 - snprintf(ioc->fw_event_q_name, MPT_KOBJ_NAME_LEN, "mpt/%d", ioc->id); 1988 - ioc->fw_event_q = alloc_workqueue(ioc->fw_event_q_name, 1989 - WQ_MEM_RECLAIM, 0); 1989 + ioc->fw_event_q = alloc_workqueue("mpt/%d", WQ_MEM_RECLAIM, 0, ioc->id); 1990 1990 if (!ioc->fw_event_q) { 1991 1991 printk(MYIOC_s_ERR_FMT "Insufficient memory to add adapter!\n", 1992 1992 ioc->name);
-3
drivers/message/fusion/mptbase.h
··· 729 729 struct list_head fw_event_list; 730 730 spinlock_t fw_event_lock; 731 731 u8 fw_events_off; /* if '1', then ignore events */ 732 - char fw_event_q_name[MPT_KOBJ_NAME_LEN]; 733 732 734 733 struct mutex sas_discovery_mutex; 735 734 u8 sas_discovery_runtime; ··· 763 764 u8 fc_link_speed[2]; 764 765 spinlock_t fc_rescan_work_lock; 765 766 struct work_struct fc_rescan_work; 766 - char fc_rescan_work_q_name[MPT_KOBJ_NAME_LEN]; 767 767 struct workqueue_struct *fc_rescan_work_q; 768 768 769 769 /* driver forced bus resets count */ ··· 776 778 spinlock_t scsi_lookup_lock; 777 779 u64 dma_mask; 778 780 u32 broadcast_aen_busy; 779 - char reset_work_q_name[MPT_KOBJ_NAME_LEN]; 780 781 struct workqueue_struct *reset_work_q; 781 782 struct delayed_work fault_reset_work; 782 783
+2 -5
drivers/message/fusion/mptfc.c
··· 1349 1349 1350 1350 /* initialize workqueue */ 1351 1351 1352 - snprintf(ioc->fc_rescan_work_q_name, sizeof(ioc->fc_rescan_work_q_name), 1353 - "mptfc_wq_%d", sh->host_no); 1354 - ioc->fc_rescan_work_q = 1355 - alloc_ordered_workqueue(ioc->fc_rescan_work_q_name, 1356 - WQ_MEM_RECLAIM); 1352 + ioc->fc_rescan_work_q = alloc_ordered_workqueue( 1353 + "mptfc_wq_%d", WQ_MEM_RECLAIM, sh->host_no); 1357 1354 if (!ioc->fc_rescan_work_q) { 1358 1355 error = -ENOMEM; 1359 1356 goto out_mptfc_host;