Skip to content

Commit 78486ed

Browse files
committed
s390/spinlock: Use symbolic names in inline assemblies
Improve readability and use symbolic names. Signed-off-by: Heiko Carstens <[email protected]>
1 parent b5f4634 commit 78486ed

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

arch/s390/include/asm/spinlock.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ static inline void arch_spin_unlock(arch_spinlock_t *lp)
8282
kcsan_release();
8383
asm_inline volatile(
8484
ALTERNATIVE("nop", ".insn rre,0xb2fa0000,7,0", ALT_FACILITY(49)) /* NIAI 7 */
85-
" sth %1,%0\n"
86-
: "=R" (((unsigned short *) &lp->lock)[1])
87-
: "d" (0) : "cc", "memory");
85+
" sth %[zero],%[lock]\n"
86+
: [lock] "=R" (((unsigned short *)&lp->lock)[1])
87+
: [zero] "d" (0)
88+
: "cc", "memory");
8889
}
8990

9091
/*

arch/s390/lib/spinlock.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ static inline int arch_load_niai4(int *lock)
7676

7777
asm_inline volatile(
7878
ALTERNATIVE("nop", ".insn rre,0xb2fa0000,4,0", ALT_FACILITY(49)) /* NIAI 4 */
79-
" l %0,%1\n"
80-
: "=d" (owner) : "Q" (*lock) : "memory");
79+
" l %[owner],%[lock]\n"
80+
: [owner] "=d" (owner) : [lock] "Q" (*lock) : "memory");
8181
return owner;
8282
}
8383

@@ -87,9 +87,9 @@ static inline int arch_cmpxchg_niai8(int *lock, int old, int new)
8787

8888
asm_inline volatile(
8989
ALTERNATIVE("nop", ".insn rre,0xb2fa0000,8,0", ALT_FACILITY(49)) /* NIAI 8 */
90-
" cs %0,%3,%1\n"
91-
: "=d" (old), "=Q" (*lock)
92-
: "0" (old), "d" (new), "Q" (*lock)
90+
" cs %[old],%[new],%[lock]\n"
91+
: [old] "+d" (old), [lock] "+Q" (*lock)
92+
: [new] "d" (new)
9393
: "cc", "memory");
9494
return expected == old;
9595
}

0 commit comments

Comments
 (0)