From: Christoph Lameter <cl@linux.com> To: Tejun Heo <tj@kernel.org> Cc: akpm@linuxfoundation.org Cc: linux-arch@vger.kernel.org Cc: Steven Rostedt <srostedt@redhat.com> Cc: linux-kernel@vger.kernel.org Subject: [guv v2 02/31] percpu: Make __verify_pcu_ptr handle per cpu pointers to arrays Date: Mon, 26 Aug 2013 20:44:19 +0000 [thread overview] Message-ID: <00000140bc5eb9ae-8673adeb-adfa-41a4-be1e-2994edde3fe8-000000@email.amazonses.com> (raw) In-Reply-To: 20130826204351.725357339@linux.com __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> Index: linux/include/linux/percpu-defs.h =================================================================== --- linux.orig/include/linux/percpu-defs.h 2013-08-22 13:39:04.000000000 -0500 +++ linux/include/linux/percpu-defs.h 2013-08-22 13:41:15.333140537 -0500 @@ -22,9 +22,12 @@ * Macro which verifies @ptr is a percpu pointer without evaluating * @ptr. This is to be used in percpu accessors to verify that the * input parameter is a percpu pointer. + * + * + 0 is required in order to convert the pointer type from a + * potential array type to a pointer to a single item of the array. */ #define __verify_pcpu_ptr(ptr) do { \ - const void __percpu *__vpp_verify = (typeof(ptr))NULL; \ + const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ (void)__vpp_verify; \ } while (0)
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Lameter <cl@linux.com> To: Tejun Heo <tj@kernel.org> Cc: akpm@linuxfoundation.org, linux-arch@vger.kernel.org, Steven Rostedt <srostedt@redhat.com>, linux-kernel@vger.kernel.org Subject: [guv v2 02/31] percpu: Make __verify_pcu_ptr handle per cpu pointers to arrays Date: Mon, 26 Aug 2013 20:44:19 +0000 [thread overview] Message-ID: <00000140bc5eb9ae-8673adeb-adfa-41a4-be1e-2994edde3fe8-000000@email.amazonses.com> (raw) In-Reply-To: 20130826204351.725357339@linux.com __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> Index: linux/include/linux/percpu-defs.h =================================================================== --- linux.orig/include/linux/percpu-defs.h 2013-08-22 13:39:04.000000000 -0500 +++ linux/include/linux/percpu-defs.h 2013-08-22 13:41:15.333140537 -0500 @@ -22,9 +22,12 @@ * Macro which verifies @ptr is a percpu pointer without evaluating * @ptr. This is to be used in percpu accessors to verify that the * input parameter is a percpu pointer. + * + * + 0 is required in order to convert the pointer type from a + * potential array type to a pointer to a single item of the array. */ #define __verify_pcpu_ptr(ptr) do { \ - const void __percpu *__vpp_verify = (typeof(ptr))NULL; \ + const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \ (void)__vpp_verify; \ } while (0)
next parent reply other threads:[~2013-08-26 20:54 UTC|newest] Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20130826204351.725357339@linux.com> 2013-08-26 20:44 ` Christoph Lameter [this message] 2013-08-26 20:44 ` [guv v2 02/31] percpu: Make __verify_pcu_ptr handle per cpu pointers to arrays Christoph Lameter 2013-08-26 20:44 ` [guv v2 03/31] Coccinelle script for __get_cpu_var conversion Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 05/31] time: Replace __get_cpu_var uses Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 04/31] net: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 06/31] scheduler: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 08/31] tracing: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-28 19:48 ` Steven Rostedt 2013-08-29 3:44 ` Masami Hiramatsu 2013-08-29 16:35 ` Christoph Lameter 2013-08-30 7:00 ` Ingo Molnar 2013-08-26 20:44 ` [guv v2 09/31] block: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 11/31] percpu: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 07/31] mm: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 10/31] rcu: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 14/31] drivers: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 13/31] kernel misc: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 12/31] watchdog: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 18/31] s390: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-28 6:27 ` Heiko Carstens 2013-08-26 20:44 ` [guv v2 17/31] mips: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 15/31] zcache/zsmalloc: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 16/31] x86: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 01/31] x86: Use this_cpu_inc/dec for debug registers Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 19/31] ia64: Replace __get_cpu_var uses Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 20/31] powerpc: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-27 8:44 ` Geert Uytterhoeven 2013-08-27 15:37 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 21/31] sparc: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-26 20:44 ` [guv v2 22/31] arm: " Christoph Lameter 2013-08-26 20:44 ` Christoph Lameter 2013-08-27 9:41 ` Catalin Marinas 2013-08-26 20:56 ` [guv v2 25/31] avr32: " Christoph Lameter 2013-08-26 20:56 ` Christoph Lameter 2013-08-27 6:58 ` Hans-Christian Egtvedt 2013-08-26 20:56 ` [guv v2 23/31] tile: " Christoph Lameter 2013-08-26 20:56 ` Christoph Lameter 2013-08-26 22:22 ` Chris Metcalf 2013-08-26 22:22 ` Chris Metcalf 2013-08-27 14:48 ` Christoph Lameter 2013-08-28 17:19 ` Chris Metcalf 2013-08-28 17:19 ` Chris Metcalf 2013-08-28 17:54 ` Christoph Lameter 2013-08-28 18:13 ` Chris Metcalf 2013-08-28 18:13 ` Chris Metcalf 2013-08-28 18:22 ` Christoph Lameter 2013-08-30 16:01 ` Chris Metcalf 2013-08-30 16:01 ` Chris Metcalf 2013-08-26 20:56 ` [guv v2 29/31] parisc: " Christoph Lameter 2013-08-26 20:56 ` Christoph Lameter 2013-08-26 20:56 ` Christoph Lameter 2013-08-26 21:16 ` [guv v2 31/31] Remove __get_cpu_var and __raw_get_cpu_var macros Christoph Lameter 2013-08-26 21:16 ` Christoph Lameter 2013-08-26 21:16 ` [guv v2 24/31] blackfin: Replace __get_cpu_var uses Christoph Lameter 2013-08-26 21:16 ` Christoph Lameter 2013-08-26 21:16 ` [guv v2 26/31] alpha: Replace __get_cpu_var Christoph Lameter 2013-08-26 21:16 ` Christoph Lameter 2013-08-26 21:56 ` [guv v2 30/31] metag: Replace __get_cpu_var uses Christoph Lameter 2013-08-26 21:56 ` Christoph Lameter 2013-08-27 9:53 ` James Hogan 2013-08-27 9:53 ` James Hogan 2013-08-26 21:56 ` [guv v2 28/31] arc: Replace __get_cpu_var uses throughout the kernel Christoph Lameter 2013-08-26 21:56 ` Christoph Lameter [not found] ` <521C2A9F.3070400@synopsys.com> [not found] ` <00000140c05d28b7-f0a2bc86-fe85-40f7-b627-32664cd616a4-000000@email.amazonses.com> 2013-08-28 4:24 ` Vineet Gupta 2013-08-28 13:46 ` Christoph Lameter 2013-08-26 21:56 ` [guv v2 27/31] sh: " Christoph Lameter 2013-08-26 21:56 ` Christoph Lameter 2013-08-26 21:56 ` Christoph Lameter 2013-09-02 21:35 ` [guv v2 04/31] net: Replace __get_cpu_var uses David Howells 2013-09-03 3:33 ` David Miller 2013-09-03 14:21 ` Christoph Lameter 2013-09-03 14:20 ` Christoph Lameter 2013-09-03 20:39 ` David Howells [not found] <20130826204138.307369532@linux.com> 2013-08-26 20:41 ` [guv v2 02/31] percpu: Make __verify_pcu_ptr handle per cpu pointers to arrays Christoph Lameter 2013-08-26 20:41 ` Christoph Lameter 2013-08-26 21:06 ` Christoph Lameter [not found] <20130826200843.526699195@linux.com> 2013-08-26 20:08 ` Christoph Lameter 2013-08-26 20:08 ` Christoph Lameter
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=00000140bc5eb9ae-8673adeb-adfa-41a4-be1e-2994edde3fe8-000000@email.amazonses.com \ --to=cl@linux.com \ --cc=akpm@linuxfoundation.org \ --cc=tj@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.