include/linux/compiler.h: unconditionally define __pmem sparse attribute
PATCH 1/1 include/linux/compiler.h: unconditionally define __pmem sparse attribute
Commit 61031952f4c8 ("arch, x86: pmem api for ensuring durability of
persistent memory updates")
defined __pmem in include/linux/compiler.h only for the case CONFIG_RCU_SPARSE_POINTER=n, probably by accident.
With CONFIG_RCU_SPARSE_POINTER=y a sparse compile gives the error:
CHECK init/main.c
arch/x86/include/asm/io.h:251:27: error: void declaration arch/x86/include/asm/io.h:251:27: error: Expected ; at end of declaration arch/x86/include/asm/io.h:251:27: error: got * arch/x86/include/asm/io.h:255:1: error: Expected ; at the end of
type declaration
arch/x86/include/asm/io.h:255:1: error: got }
This happens because the __pmem in arch/x86/include/asm/io.h:251:
static inline void __pmem *arch_memremap_pmem([...])
is undefined.
Define __pmem unconditionally in include/linux/compiler.h.
--- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/compiler.h +1 -1
@@ -21,8 +21,8 @@# define __rcu __attribute__((noderef, address_space(4)))#else # define __rcu -# define __pmem __attribute__((noderef, address_space(5)))#endif +# define __pmem __attribute__((noderef, address_space(5)))extern void __chk_user_ptr (const volatile void __user *);extern void __chk_io_ptr (const volatile void __iomem *);#else
Signature · 1 line
2.4.5
Quoted 31 lines · Nicolai Stange
Commit
61031952f4c8("arch, x86: pmem api for ensuring durability of
persistent memory updates")
defined__pmemininclude/linux/compiler.honly for the caseCONFIG_RCU_SPARSE_POINTER=n, probably by accident.With
CONFIG_RCU_SPARSE_POINTER=ya sparse compile gives the error:
CHECKinit/main.c
arch/x86/include/asm/io.h:251:27: error: void declarationarch/x86/include/asm/io.h:251:27: error: Expected ; at end of declarationarch/x86/include/asm/io.h:251:27: error: got *arch/x86/include/asm/io.h:255:1: error: Expected ; at the end of
type declaration
arch/x86/include/asm/io.h:255:1: error: got }This happens because the
__pmeminarch/x86/include/asm/io.h:251:
static inline void__pmem*arch_memremap_pmem([...])
is undefined.Define
__pmemunconditionally ininclude/linux/compiler.h.Signed-off-by Nicolai Stange <[email protected]>--- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/compiler.h +0
-0
include/linux/compiler.h line 28
Quoted 9 lines
include/linux/compiler.h +1
-1@@ -21,8 +21,8 @@# define __rcu __attribute__((noderef, address_space(4)))#else # define __rcu -# define __pmem __attribute__((noderef, address_space(5)))#endif +# define __pmem __attribute__((noderef, address_space(5)))extern void __chk_user_ptr (const volatile void __user *);extern void __chk_io_ptr (const volatile void __iomem *);#else
Yep, thank you for the fix. I think Dan already has a version of this queued up in his tree for his next pull request:
Already fixed in linux-next. Sorry for the noise.