瀏覽代碼

sparse: fix misplaced __pmem definition

Move the definition of __pmem outside of CONFIG_SPARSE_RCU_POINTER to fix:

drivers/nvdimm/pmem.c:198:17: sparse: too many arguments for function __builtin_expect
drivers/nvdimm/pmem.c:36:33: sparse: expected ; at end of declaration
drivers/nvdimm/pmem.c:48:21: sparse: void declaration

...due to __pmem failing to be defined in some configurations when
CONFIG_SPARSE_RCU_POINTER=y.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams 10 年之前
父節點
當前提交
31f0245545
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/linux/compiler.h

+ 1 - 1
include/linux/compiler.h

@@ -17,11 +17,11 @@
 # define __release(x)	__context__(x,-1)
 # define __release(x)	__context__(x,-1)
 # define __cond_lock(x,c)	((c) ? ({ __acquire(x); 1; }) : 0)
 # define __cond_lock(x,c)	((c) ? ({ __acquire(x); 1; }) : 0)
 # define __percpu	__attribute__((noderef, address_space(3)))
 # define __percpu	__attribute__((noderef, address_space(3)))
+# define __pmem		__attribute__((noderef, address_space(5)))
 #ifdef CONFIG_SPARSE_RCU_POINTER
 #ifdef CONFIG_SPARSE_RCU_POINTER
 # define __rcu		__attribute__((noderef, address_space(4)))
 # define __rcu		__attribute__((noderef, address_space(4)))
 #else
 #else
 # define __rcu
 # define __rcu
-# define __pmem		__attribute__((noderef, address_space(5)))
 #endif
 #endif
 extern void __chk_user_ptr(const volatile void __user *);
 extern void __chk_user_ptr(const volatile void __user *);
 extern void __chk_io_ptr(const volatile void __iomem *);
 extern void __chk_io_ptr(const volatile void __iomem *);