lkml.org 
[lkml]   [2022]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/5] 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.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/include/asm/cmpxchg.h | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/s390/include/asm/cmpxchg.h b/arch/s390/include/asm/cmpxchg.h
index 2ad057b94481..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" (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;
}
--
2.34.1
\
 
 \ /
  Last update: 2022-11-02 15:20    [W:0.204 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site