Messages in this thread Patch in this message | | | From | Brian Gerst <> | Subject | [PATCH] x86, percpu: Fix __this_cpu_ptr with const pointers | Date | Fri, 10 Sep 2010 01:31:04 -0400 |
| |
Fix this error when the pointer is marked const: error: read-only variable 'tcp_ptr__' used as 'asm' output
Signed-off-by: Brian Gerst <brgerst@gmail.com> CC: Stephen Rothwell <sfr@canb.auug.org.au> --- arch/x86/include/asm/percpu.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index fe418dd..f62b52c 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -54,12 +54,12 @@ */ #define __this_cpu_ptr(ptr) \ ({ \ - typeof(ptr) tcp_ptr__ = (ptr); \ + unsigned long tcp_ptr__; \ __verify_pcpu_ptr(ptr); \ asm volatile("add " __percpu_arg(1) ", %0" \ - : "+r" (tcp_ptr__) \ - : "m" (this_cpu_off)); \ - tcp_ptr__; \ + : "=r" (tcp_ptr__) \ + : "m" (this_cpu_off), "0" (ptr)); \ + (typeof(ptr) __kernel __force) tcp_ptr__; \ }) #else #define __percpu_arg(x) "%P" #x -- 1.7.2.2
| |