summaryrefslogtreecommitdiff
path: root/arch/loongarch/include/asm/barrier.h
diff options
context:
space:
mode:
authorWANG Xuerui <git@xen0n.name>2022-07-26 18:57:16 +0300
committerHuacai Chen <chenhuacai@loongson.cn>2022-07-29 13:22:32 +0300
commitd8e7f201a4cf148c3801cdc9603963061d28d64f (patch)
tree5bbe5881044a3dcb4ad37fc59a49f9c9e815c3db /arch/loongarch/include/asm/barrier.h
parente0dccc3b76fb35bb257b4118367a883073d7390e (diff)
downloadlinux-d8e7f201a4cf148c3801cdc9603963061d28d64f.tar.xz
LoongArch: Use ABI names of registers where appropriate
Some of the assembly in the LoongArch port seem to come from a prehistoric time, when the assembler didn't even have support for the ABI names we all come to know and love, thus used raw register numbers which hampered readability. The usages are found with a regex match inside arch/loongarch, then manually adjusted for those non-definitions. Signed-off-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/barrier.h')
-rw-r--r--arch/loongarch/include/asm/barrier.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/loongarch/include/asm/barrier.h b/arch/loongarch/include/asm/barrier.h
index b6517eeeb141..cda977675854 100644
--- a/arch/loongarch/include/asm/barrier.h
+++ b/arch/loongarch/include/asm/barrier.h
@@ -48,9 +48,9 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
__asm__ __volatile__(
"sltu %0, %1, %2\n\t"
#if (__SIZEOF_LONG__ == 4)
- "sub.w %0, $r0, %0\n\t"
+ "sub.w %0, $zero, %0\n\t"
#elif (__SIZEOF_LONG__ == 8)
- "sub.d %0, $r0, %0\n\t"
+ "sub.d %0, $zero, %0\n\t"
#endif
: "=r" (mask)
: "r" (index), "r" (size)