diff options
author | Luc Van Oostenryck <[email protected]> | 2019-12-04 02:06:23 +0100 |
---|---|---|
committer | Dennis Zhou <[email protected]> | 2020-01-31 11:15:59 -0800 |
commit | becef184dfe9bfef522c80501d22a5e02efba8d8 (patch) | |
tree | c87e1932bc76722b1bb01ec0f4de81e6af106d3b /drivers/usb/cdns3/cdns3-debug.h | |
parent | aedc0650f9135f3b92b39cbed1a8fe98d8088825 (diff) |
percpu: fix __percpu annotation in asm-generic
The generic implementation of raw_cpu_generic_add_return() is:
#define raw_cpu_generic_add_return(pcp, val) \
({ \
typeof(&(pcp)) __p = raw_cpu_ptr(&(pcp)); \
\
*__p += val; \
*__p; \
})
where the 'pcp' argument is a __percpu lvalue.
There, the variable '__p' is declared as a __percpu pointer
the type of the address of 'pcp') but:
1) the value assigned to it, the return value of raw_cpu_ptr(), is
a plain (__kernel) pointer, not a __percpu one.
2) this variable is dereferenced just after while a __percpu
pointer is implicitly __noderef.
So, fix the declaration of the 'pcp' variable to its correct type:
the plain (non-percpu) pointer corresponding to pcp's address,
using the fact that typeof() ignores the address space and the
'noderef' attribute of its agument.
Same for raw_cpu_generic_xchg(), raw_cpu_generic_cmpxchg() &
raw_cpu_generic_cmpxchg_double().
This removes 209 warnings on ARM, 525 on ARM64, 220 on x86 &
more than 2600 on ppc64 (all of them with the default config).
Cc: Tejun Heo <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Reported-by: Ben Dooks <[email protected]>
Signed-off-by: Luc Van Oostenryck <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Signed-off-by: Dennis Zhou <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-debug.h')
0 files changed, 0 insertions, 0 deletions