summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2024-11-26 14:28:23 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-11-28 14:12:04 +0100
commit78486ed9e76b72d81e7bb142adb47194f95e188d (patch)
treeed97954e87776ecf069231f3a1c600103a941bc8 /arch/s390
parents390: Support PREEMPT_DYNAMIC (diff)
downloadlinux-78486ed9e76b72d81e7bb142adb47194f95e188d.tar.xz
linux-78486ed9e76b72d81e7bb142adb47194f95e188d.zip
s390/spinlock: Use symbolic names in inline assemblies
Improve readability and use symbolic names. Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/spinlock.h7
-rw-r--r--arch/s390/lib/spinlock.c10
2 files changed, 9 insertions, 8 deletions
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index ac868a9bb0d1..f2722775baf6 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -82,9 +82,10 @@ static inline void arch_spin_unlock(arch_spinlock_t *lp)
kcsan_release();
asm_inline volatile(
ALTERNATIVE("nop", ".insn rre,0xb2fa0000,7,0", ALT_FACILITY(49)) /* NIAI 7 */
- " sth %1,%0\n"
- : "=R" (((unsigned short *) &lp->lock)[1])
- : "d" (0) : "cc", "memory");
+ " sth %[zero],%[lock]\n"
+ : [lock] "=R" (((unsigned short *)&lp->lock)[1])
+ : [zero] "d" (0)
+ : "cc", "memory");
}
/*
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index 09d735010ee1..255c0a8202e7 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -76,8 +76,8 @@ static inline int arch_load_niai4(int *lock)
asm_inline volatile(
ALTERNATIVE("nop", ".insn rre,0xb2fa0000,4,0", ALT_FACILITY(49)) /* NIAI 4 */
- " l %0,%1\n"
- : "=d" (owner) : "Q" (*lock) : "memory");
+ " l %[owner],%[lock]\n"
+ : [owner] "=d" (owner) : [lock] "Q" (*lock) : "memory");
return owner;
}
@@ -87,9 +87,9 @@ static inline int arch_cmpxchg_niai8(int *lock, int old, int new)
asm_inline volatile(
ALTERNATIVE("nop", ".insn rre,0xb2fa0000,8,0", ALT_FACILITY(49)) /* NIAI 8 */
- " cs %0,%3,%1\n"
- : "=d" (old), "=Q" (*lock)
- : "0" (old), "d" (new), "Q" (*lock)
+ " cs %[old],%[new],%[lock]\n"
+ : [old] "+d" (old), [lock] "+Q" (*lock)
+ : [new] "d" (new)
: "cc", "memory");
return expected == old;
}