Skip to contentSkip to conversation

workqueue: use NR_STD_WORKER_POOLS instead of hardcoded value

PATCH Applied Maninder Singh 2 participants 2 messages Apr 7 1 message not in the archive Workqueue

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20260407034221epcas5p333b582f91ee9c72f55cba792b750aa1f@epcas5p3.samsung.com

#1 lore raw

PATCH 1/1 workqueue: use NR_STD_WORKER_POOLS instead of hardcoded value

use NR_STD_WORKER_POOLS for irq_work_fns[] array definition. NR_STD_WORKER_POOLS is also 2, but better to use MACRO. Initialization loop for_each_bh_worker_pool() also uses same MACRO.

---
 kernel/workqueue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
index 08b1c786b463..16b65a7f1ac2 100644
@@ -7932,7 +7932,7 @@ void __init workqueue_init_early(void)
 {
 	struct wq_pod_type *pt = &wq_pod_types[WQ_AFFN_SYSTEM];
 	int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL };
-	void (*irq_work_fns[2])(struct irq_work *) = { bh_pool_kick_normal,
+	void (*irq_work_fns[NR_STD_WORKER_POOLS])(struct irq_work *) = { bh_pool_kick_normal,
 						       bh_pool_kick_highpri };
 	int i, cpu;
 
Signature · 1 line
2.34.1
maintainer Applied
#2 lore raw

Hello,

Quoted 3 lines · Maninder Singh

use NR_STD_WORKER_POOLS for irq_work_fns[] array definition. NR_STD_WORKER_POOLS is also 2, but better to use MACRO. Initialization loop for_each_bh_worker_pool() also uses same MACRO.

Applied to wq/for-7.1 with a small formatting tweak so the longer declaration doesn't leave the initializer misaligned:

	void (*irq_work_fns[NR_STD_WORKER_POOLS])(struct irq_work *) =
		{ bh_pool_kick_normal, bh_pool_kick_highpri };

Thanks.

--
tejun