linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use correct byte-sized register constraint in __xchg_op()
@ 2012-04-02 23:15 Jeremy Fitzhardinge
  2012-04-04  0:37 ` Josh Boyer
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2012-04-02 23:15 UTC (permalink / raw)
  To: the arch/x86 maintainers
  Cc: Linux Kernel Mailing List, Thomas Reitmayr, leigh123linux, Dave Jones

x86-64 can access the low half of any register, but i386 can only do
it with a subset of registers.  'r' causes compilation failures on i386,
but 'q' expresses the constraint properly.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Reported-by: Leigh Scott <leigh123linux@googlemail.com>
Tested-by: Thomas Reitmayr <treitmayr@devbase.at>

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index b3b7332..bc18d0e 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -43,7 +43,7 @@ extern void __add_wrong_size(void)
 		switch (sizeof(*(ptr))) {				\
 		case __X86_CASE_B:					\
 			asm volatile (lock #op "b %b0, %1\n"		\
-				      : "+r" (__ret), "+m" (*(ptr))	\
+				      : "+q" (__ret), "+m" (*(ptr))	\
 				      : : "memory", "cc");		\
 			break;						\
 		case __X86_CASE_W:					\



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-06 16:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 23:15 [PATCH] Use correct byte-sized register constraint in __xchg_op() Jeremy Fitzhardinge
2012-04-04  0:37 ` Josh Boyer
2012-04-05 20:27   ` Josh Boyer
2012-04-05 21:16     ` Thomas Reitmayr
2012-04-06  7:46 ` Jeremy Fitzhardinge
2012-04-06 16:52 ` [tip:x86/urgent] x86: " tip-bot for Jeremy Fitzhardinge
2012-04-06 16:53 ` [tip:x86/urgent] x86: Use correct byte-sized register constraint in __add() tip-bot for H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).