Commit 825dbc6f authored by Ben Dooks's avatar Ben Dooks Committed by Dennis Zhou

percpu: add __percpu to SHIFT_PERCPU_PTR

The SHIFT_PERCPU_PTR() returns a pointer used by a number
of functions that expect the pointer to be __percpu annotated
(sparse address space 3). Adding __percpu to this makes the
following sparse warnings go away.

Note, this then creates the problem the __percup is marked
as noderef, which may need removing for some of the internal
functions, or to remove other warnings.

mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:385:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:385:13:    got signed char *
mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:385:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:385:13:    got signed char *
mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:385:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:385:13:    got signed char *
mm/vmstat.c:385:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:385:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:385:13:    got signed char *
mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:401:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:401:13:    got signed char *
mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:401:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:401:13:    got signed char *
mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:401:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:401:13:    got signed char *
mm/vmstat.c:401:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:401:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:401:13:    got signed char *
mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:429:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:429:13:    got signed char *
mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:429:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:429:13:    got signed char *
mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:429:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:429:13:    got signed char *
mm/vmstat.c:429:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:429:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:429:13:    got signed char *
mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:445:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:445:13:    got signed char *
mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:445:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:445:13:    got signed char *
mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:445:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:445:13:    got signed char *
mm/vmstat.c:445:13: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:445:13:    expected signed char [noderef] [usertype] <asn:3> *__p
mm/vmstat.c:445:13:    got signed char *
mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:763:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:763:29:    got signed char *
mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:763:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:763:29:    got signed char *
mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:763:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:763:29:    got signed char *
mm/vmstat.c:763:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:763:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:763:29:    got signed char *
mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:825:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:825:29:    got signed char *
mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:825:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:825:29:    got signed char *
mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:825:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:825:29:    got signed char *
mm/vmstat.c:825:29: warning: incorrect type in initializer (different address spaces)
mm/vmstat.c:825:29:    expected signed char [noderef] <asn:3> *__p
mm/vmstat.c:825:29:    got signed char *
Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: default avatarDennis Zhou <dennis@kernel.org>
parent 4f5cafb5
...@@ -229,7 +229,7 @@ do { \ ...@@ -229,7 +229,7 @@ do { \
* pointer value. The weird cast keeps both GCC and sparse happy. * pointer value. The weird cast keeps both GCC and sparse happy.
*/ */
#define SHIFT_PERCPU_PTR(__p, __offset) \ #define SHIFT_PERCPU_PTR(__p, __offset) \
RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset)) RELOC_HIDE((typeof(*(__p)) __kernel __percpu __force *)(__p), (__offset))
#define per_cpu_ptr(ptr, cpu) \ #define per_cpu_ptr(ptr, cpu) \
({ \ ({ \
......
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