Commit 18cb2aef authored by Namhyung Kim's avatar Namhyung Kim Committed by Tejun Heo

percpu: handle __percpu notations in UP accessors

UP accessors didn't take care of __percpu notations leading to a lot
of spurious sparse warnings on UP configurations.  Fix it.
Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 4a386c3e
...@@ -70,11 +70,16 @@ extern void setup_per_cpu_areas(void); ...@@ -70,11 +70,16 @@ extern void setup_per_cpu_areas(void);
#else /* ! SMP */ #else /* ! SMP */
#define per_cpu(var, cpu) (*((void)(cpu), &(var))) #define VERIFY_PERCPU_PTR(__p) ({ \
#define __get_cpu_var(var) (var) __verify_pcpu_ptr((__p)); \
#define __raw_get_cpu_var(var) (var) (typeof(*(__p)) __kernel __force *)(__p); \
#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) })
#define __this_cpu_ptr(ptr) this_cpu_ptr(ptr)
#define per_cpu(var, cpu) (*((void)(cpu), VERIFY_PERCPU_PTR(&(var))))
#define __get_cpu_var(var) (*VERIFY_PERCPU_PTR(&(var)))
#define __raw_get_cpu_var(var) (*VERIFY_PERCPU_PTR(&(var)))
#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0)
#define __this_cpu_ptr(ptr) this_cpu_ptr(ptr)
#endif /* SMP */ #endif /* SMP */
......
...@@ -149,7 +149,7 @@ extern void __init percpu_init_late(void); ...@@ -149,7 +149,7 @@ extern void __init percpu_init_late(void);
#else /* CONFIG_SMP */ #else /* CONFIG_SMP */
#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR((ptr)); })
/* can't distinguish from other static vars, always false */ /* can't distinguish from other static vars, always false */
static inline bool is_kernel_percpu_address(unsigned long addr) static inline bool is_kernel_percpu_address(unsigned long addr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment