mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
percpu: make accessors check for percpu pointer in sparse
The previous patch made sparse warn about percpu variables being used directly without going through percpu accessors. This patch implements the other half - checking whether non percpu variable is passed into percpu accessors. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
e0fdb0e050
commit
545695fb41
3 changed files with 24 additions and 4 deletions
|
@ -237,6 +237,7 @@ extern void __bad_size_call_parameter(void);
|
|||
|
||||
#define __pcpu_size_call_return(stem, variable) \
|
||||
({ typeof(variable) pscr_ret__; \
|
||||
__verify_pcpu_ptr(&(variable)); \
|
||||
switch(sizeof(variable)) { \
|
||||
case 1: pscr_ret__ = stem##1(variable);break; \
|
||||
case 2: pscr_ret__ = stem##2(variable);break; \
|
||||
|
@ -250,6 +251,7 @@ extern void __bad_size_call_parameter(void);
|
|||
|
||||
#define __pcpu_size_call(stem, variable, ...) \
|
||||
do { \
|
||||
__verify_pcpu_ptr(&(variable)); \
|
||||
switch(sizeof(variable)) { \
|
||||
case 1: stem##1(variable, __VA_ARGS__);break; \
|
||||
case 2: stem##2(variable, __VA_ARGS__);break; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue