]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
workqueue: use NR_STD_WORKER_POOLS instead of hardcoded value
authorManinder Singh <maninder1.s@samsung.com>
Tue, 7 Apr 2026 03:42:15 +0000 (09:12 +0530)
committerTejun Heo <tj@kernel.org>
Tue, 7 Apr 2026 18:13:19 +0000 (08:13 -1000)
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.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c

index b1a28c51d4f23c703a49a2960746692fec8e91dd..900b864a30b042dc99794ad5f7a11c6ebcded9f6 100644 (file)
@@ -7900,8 +7900,8 @@ 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,
-                                                      bh_pool_kick_highpri };
+       void (*irq_work_fns[NR_STD_WORKER_POOLS])(struct irq_work *) =
+               { bh_pool_kick_normal, bh_pool_kick_highpri };
        int i, cpu;
 
        BUILD_BUG_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));