percpu: add __percpu for sparse.
We have to make __kernel "__attribute__((address_space(0)))" so we can cast to it. tj: * put_cpu_var() update. * Annotations added to dynamic allocator interface. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
@@ -41,7 +41,9 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
|
||||
* Only S390 provides its own means of moving the pointer.
|
||||
*/
|
||||
#ifndef SHIFT_PERCPU_PTR
|
||||
#define SHIFT_PERCPU_PTR(__p, __offset) RELOC_HIDE((__p), (__offset))
|
||||
/* Weird cast keeps both GCC and sparse happy. */
|
||||
#define SHIFT_PERCPU_PTR(__p, __offset) \
|
||||
RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user