lkml.org 
[lkml]   [2010]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86, percpu: Fix __this_cpu_ptr with const pointers
Date
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


\
 
 \ /
  Last update: 2010-09-10 07:33    [W:0.048 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site