2b52cb3
From: H. Peter Anvin <hpa@zytor.com>
2b52cb3
Date: Fri, 6 Apr 2012 16:30:57 +0000 (-0700)
2b52cb3
Subject: x86: Use correct byte-sized register constraint in __add()
2b52cb3
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftip%2Ftip.git;a=commitdiff_plain;h=8c91c5325e107ec17e40a59a47c6517387d64eb7
2b52cb3
2b52cb3
x86: Use correct byte-sized register constraint in __add()
2b52cb3
2b52cb3
Similar to:
2b52cb3
2b52cb3
 2ca052a x86: Use correct byte-sized register constraint in __xchg_op()
2b52cb3
2b52cb3
... the __add() macro also needs to use a "q" constraint in the
2b52cb3
byte-sized case, lest we try to generate an illegal register.
2b52cb3
2b52cb3
Link: http://lkml.kernel.org/r/4F7A3315.501@goop.org
2b52cb3
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2b52cb3
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
2b52cb3
Cc: Leigh Scott <leigh123linux@googlemail.com>
2b52cb3
Cc: Thomas Reitmayr <treitmayr@devbase.at>
2b52cb3
Cc: <stable@vger.kernel.org> v3.3
2b52cb3
---
2b52cb3
2b52cb3
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
2b52cb3
index bc18d0e..99480e5 100644
2b52cb3
--- a/arch/x86/include/asm/cmpxchg.h
2b52cb3
+++ b/arch/x86/include/asm/cmpxchg.h
2b52cb3
@@ -173,7 +173,7 @@ extern void __add_wrong_size(void)
2b52cb3
 		switch (sizeof(*(ptr))) {				\
2b52cb3
 		case __X86_CASE_B:					\
2b52cb3
 			asm volatile (lock "addb %b1, %0\n"		\
2b52cb3
-				      : "+m" (*(ptr)) : "ri" (inc)	\
2b52cb3
+				      : "+m" (*(ptr)) : "qi" (inc)	\
2b52cb3
 				      : "memory", "cc");		\
2b52cb3
 			break;						\
2b52cb3
 		case __X86_CASE_W:					\