aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2013-08-23 15:01:58 -0400
committerTejun Heo <tj@kernel.org>2013-08-23 16:08:27 -0400
commitabec1a806e0c3cf168999667d5fb6218398ef12a (patch)
tree167e441fc26b6b404366d0310e41e32f52869ec6
parenta4244454df1296e90cc961c1b636b1176ef0d9a0 (diff)
percpu: Make __verify_pcu_ptr handle per cpu pointers to arrays
__verify_pcpu_ptr() will cause a compilation failure if the type of the pointer is a pointer to a fixed array of objects. Adding zero to the pointer converts the type of pointer to that pointing to a single object of the array. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--include/linux/percpu-defs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 27ef6b190ea6..57e890abe1f0 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -22,9 +22,12 @@
22 * Macro which verifies @ptr is a percpu pointer without evaluating 22 * Macro which verifies @ptr is a percpu pointer without evaluating
23 * @ptr. This is to be used in percpu accessors to verify that the 23 * @ptr. This is to be used in percpu accessors to verify that the
24 * input parameter is a percpu pointer. 24 * input parameter is a percpu pointer.
25 *
26 * + 0 is required in order to convert the pointer type from a
27 * potential array type to a pointer to a single item of the array.
25 */ 28 */
26#define __verify_pcpu_ptr(ptr) do { \ 29#define __verify_pcpu_ptr(ptr) do { \
27 const void __percpu *__vpp_verify = (typeof(ptr))NULL; \ 30 const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
28 (void)__vpp_verify; \ 31 (void)__vpp_verify; \
29} while (0) 32} while (0)
30 33