summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/cmpxchg.h
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2022-11-02 17:18:07 +0300
committerHeiko Carstens <hca@linux.ibm.com>2022-11-21 15:36:15 +0300
commite388d66f032166c8e8c4efd9e6c6f43610378903 (patch)
treeb970ae27fe944c1ef27901897ec3736fe5a606e4 /arch/s390/include/asm/cmpxchg.h
parentce968f654570dbd9cac7de694681640061559d3b (diff)
downloadlinux-e388d66f032166c8e8c4efd9e6c6f43610378903.tar.xz
s390/cmpxchg: remove digits from input constraints
Instead of using a digit for input constraints simply initialize the corresponding output operand in C code and use a "+" constraint modifier. Link: https://lore.kernel.org/r/Y2J8H82B6JhJhrp2@osiris Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/cmpxchg.h')
-rw-r--r--arch/s390/include/asm/cmpxchg.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/s390/include/asm/cmpxchg.h b/arch/s390/include/asm/cmpxchg.h
index 02165acdaa93..1c5785b851ec 100644
--- a/arch/s390/include/asm/cmpxchg.h
+++ b/arch/s390/include/asm/cmpxchg.h
@@ -142,26 +142,24 @@ static __always_inline unsigned long __cmpxchg(unsigned long address,
return prev >> shift;
}
case 4: {
- unsigned int prev;
+ unsigned int prev = old;
asm volatile(
" cs %[prev],%[new],%[address]\n"
- : [prev] "=&d" (prev),
+ : [prev] "+&d" (prev),
[address] "+Q" (*(int *)address)
- : "0" ((unsigned int)old),
- [new] "d" (new)
+ : [new] "d" (new)
: "memory", "cc");
return prev;
}
case 8: {
- unsigned long prev;
+ unsigned long prev = old;
asm volatile(
" csg %[prev],%[new],%[address]\n"
- : [prev] "=&d" (prev),
+ : [prev] "+&d" (prev),
[address] "+QS" (*(long *)address)
- : "0" (old),
- [new] "d" (new)
+ : [new] "d" (new)
: "memory", "cc");
return prev;
}