Skip to content

Commit c4c8f36

Browse files
ubizjakhtejun
authored andcommitted
workqueue: Correct declaration of cpu_pwq in struct workqueue_struct
cpu_pwq is used in various percpu functions that expect variable in __percpu address space. Correct the declaration of cpu_pwq to struct pool_workqueue __rcu * __percpu *cpu_pwq to declare the variable as __percpu pointer. The patch also fixes following sparse errors: workqueue.c:380:37: warning: duplicate [noderef] workqueue.c:380:37: error: multiple address spaces given: __rcu & __percpu workqueue.c:2271:15: error: incompatible types in comparison expression (different address spaces): workqueue.c:2271:15: struct pool_workqueue [noderef] __rcu * workqueue.c:2271:15: struct pool_workqueue [noderef] __percpu * and uncovers a couple of exisiting "incorrect type in assignment" warnings (from __rcu address space), which this patch does not address. Found by GCC's named address space checks. There were no changes in the resulting object files. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Cc: Tejun Heo <tj@kernel.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 8bc3547 commit c4c8f36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/workqueue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ struct workqueue_struct {
377377

378378
/* hot fields used during command issue, aligned to cacheline */
379379
unsigned int flags ____cacheline_aligned; /* WQ: WQ_* flags */
380-
struct pool_workqueue __percpu __rcu **cpu_pwq; /* I: per-cpu pwqs */
380+
struct pool_workqueue __rcu * __percpu *cpu_pwq; /* I: per-cpu pwqs */
381381
struct wq_node_nr_active *node_nr_active[]; /* I: per-node nr_active */
382382
};
383383

0 commit comments

Comments
 (0)