Because 'slot' is used within an RCU read-lock, it must not be accessed directly but with RCU helpers. Annotate the pointer to enforce checking this. Sparse confirms the missing annotation:
drivers/hwspinlock/hwspinlock_core.c:392:9: warning: incorrect type in assignment (different address spaces) drivers/hwspinlock/hwspinlock_core.c:392:9: expected void **slot drivers/hwspinlock/hwspinlock_core.c:392:9: got void [noderef] __rcu ** drivers/hwspinlock/hwspinlock_core.c:392:9: warning: incorrect type in assignment (different address spaces) drivers/hwspinlock/hwspinlock_core.c:392:9: expected void **slot drivers/hwspinlock/hwspinlock_core.c:392:9: got void [noderef] __rcu ** drivers/hwspinlock/hwspinlock_core.c:393:48: warning: incorrect type in argument 1 (different address spaces) drivers/hwspinlock/hwspinlock_core.c:393:48: expected void [noderef] __rcu **slot drivers/hwspinlock/hwspinlock_core.c:393:48: got void **slot drivers/hwspinlock/hwspinlock_core.c:397:30: warning: incorrect type in assignment (different address spaces) drivers/hwspinlock/hwspinlock_core.c:397:30: expected void **slot drivers/hwspinlock/hwspinlock_core.c:397:30: got void [noderef] __rcu ** drivers/hwspinlock/hwspinlock_core.c:392:9: warning: incorrect type in argument 1 (different address spaces) drivers/hwspinlock/hwspinlock_core.c:392:9: expected void [noderef] __rcu **slot drivers/hwspinlock/hwspinlock_core.c:392:9: got void **slot drivers/hwspinlock/hwspinlock_core.c:392:9: warning: incorrect type in assignment (different address spaces) drivers/hwspinlock/hwspinlock_core.c:392:9: expected void **slot drivers/hwspinlock/hwspinlock_core.c:392:9: got void [noderef] __rcu ** Signed-off-by: Wolfram Sang <[email protected]> --- drivers/hwspinlock/hwspinlock_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index a509b73da190..c97d68050102 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -372,7 +372,7 @@ int of_hwspin_lock_get_id(struct device_node *np, int index) struct of_phandle_args args; struct hwspinlock *hwlock; struct radix_tree_iter iter; - void **slot; + void __rcu **slot; int id; int ret; -- 2.47.3

