[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1284096664-4539-1-git-send-email-brgerst@gmail.com>
Date: Fri, 10 Sep 2010 01:31:04 -0400
From: Brian Gerst <brgerst@...il.com>
To: tj@...nel.org
Cc: linux-kernel@...r.kernel.org,
Stephen Rothwell <sfr@...b.auug.org.au>
Subject: [PATCH] x86, percpu: Fix __this_cpu_ptr with const pointers
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@...il.com>
CC: Stephen Rothwell <sfr@...b.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists