summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/workqueue.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index cc09c562e479..b4793408969d 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -495,14 +495,12 @@ static struct global_cwq *get_gcwq(unsigned int cpu)
static atomic_t *get_pool_nr_running(struct worker_pool *pool)
{
int cpu = pool->gcwq->cpu;
- atomic_t (*nr_running)[NR_WORKER_POOLS];
+ int idx = worker_pool_pri(pool);
if (cpu != WORK_CPU_UNBOUND)
- nr_running = &per_cpu(pool_nr_running, cpu);
+ return &per_cpu(pool_nr_running, cpu)[idx];
else
- nr_running = &unbound_pool_nr_running;
-
- return nr_running[worker_pool_pri(pool)];
+ return &unbound_pool_nr_running[idx];
}
static struct cpu_workqueue_struct *get_cwq(unsigned int cpu,