mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
4a386c3e17
commit
18cb2aef91
2 changed files with 11 additions and 6 deletions
|
@ -70,11 +70,16 @@ extern void setup_per_cpu_areas(void);
|
|||
|
||||
#else /* ! SMP */
|
||||
|
||||
#define per_cpu(var, cpu) (*((void)(cpu), &(var)))
|
||||
#define __get_cpu_var(var) (var)
|
||||
#define __raw_get_cpu_var(var) (var)
|
||||
#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0)
|
||||
#define __this_cpu_ptr(ptr) this_cpu_ptr(ptr)
|
||||
#define VERIFY_PERCPU_PTR(__p) ({ \
|
||||
__verify_pcpu_ptr((__p)); \
|
||||
(typeof(*(__p)) __kernel __force *)(__p); \
|
||||
})
|
||||
|
||||
#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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue