]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/cmpxchg: remove digits from input constraints
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 2 Nov 2022 14:18:07 +0000 (15:18 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 21 Nov 2022 12:36:15 +0000 (13:36 +0100)
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>
arch/s390/include/asm/cmpxchg.h

index 02165acdaa93f1216db568798910ffcee6922e12..1c5785b851ecdc01982188e188483ec5901eb237 100644 (file)
@@ -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;
        }