[PATCH] x86: correct inline asm constraints in __cmpxchg_double()

From: Juergen Gross
Date: Wed Sep 05 2018 - 05:32:26 EST


Specifying "=a" for output constraints and "a" for input seems to be
wrong. Instead "0" should be used for the input constraint.

Fixes: cdcd629869fab ("x86: Fix and improve cmpxchg_double{,_local}()")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
arch/x86/include/asm/cmpxchg.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index a55d79b233d3..b3b4d61a8969 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -245,7 +245,7 @@ extern void __add_wrong_size(void)
asm volatile(pfx "cmpxchg%c4b %2; sete %0" \
: "=a" (__ret), "+d" (__old2), \
"+m" (*(p1)), "+m" (*(p2)) \
- : "i" (2 * sizeof(long)), "a" (__old1), \
+ : "i" (2 * sizeof(long)), "0" (__old1), \
"b" (__new1), "c" (__new2)); \
__ret; \
})
--
2.16.4


--------------F7AC99E4326795D3F57926D8--