LoongArch: Remove useless header compiler.h
authorJun Yi <yijun@loongson.cn>
Thu, 21 Jul 2022 11:10:49 +0000 (19:10 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 29 Jul 2022 10:22:32 +0000 (18:22 +0800)
The content of LoongArch's compiler.h is trivial, with some unused
anywhere, so inline the definitions and remove the header.

Signed-off-by: Jun Yi <yijun@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig
arch/loongarch/include/asm/atomic.h
arch/loongarch/include/asm/compiler.h [deleted file]
arch/loongarch/include/asm/futex.h
arch/loongarch/include/asm/irqflags.h
arch/loongarch/include/asm/local.h
arch/loongarch/kernel/reset.c
arch/loongarch/lib/delay.c

index b57daee98b89c0988f200b7d0217350d939fb1f2..62b5b07fa4e1cce1e3a1668d4501ffba0ac73869 100644 (file)
@@ -69,7 +69,6 @@ config LOONGARCH
        select GENERIC_TIME_VSYSCALL
        select GPIOLIB
        select HAVE_ARCH_AUDITSYSCALL
-       select HAVE_ARCH_COMPILER_H
        select HAVE_ARCH_MMAP_RND_BITS if MMU
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
index dc2ae4f22c8e110140d2144c9ee97d8fc7cd06e9..6b9aca9ab6e9f284e64d57d1d43f61b97726c166 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/types.h>
 #include <asm/barrier.h>
 #include <asm/cmpxchg.h>
-#include <asm/compiler.h>
 
 #if __SIZEOF_LONG__ == 4
 #define __LL           "ll.w   "
@@ -163,8 +162,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v)
                "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "I" (-i));
        } else {
                __asm__ __volatile__(
@@ -176,8 +174,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v)
                "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "r" (i));
        }
 
@@ -326,8 +323,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v)
                "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "I" (-i));
        } else {
                __asm__ __volatile__(
@@ -339,8 +335,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v)
                "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "r" (i));
        }
 
diff --git a/arch/loongarch/include/asm/compiler.h b/arch/loongarch/include/asm/compiler.h
deleted file mode 100644 (file)
index 657cebe..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
- */
-#ifndef _ASM_COMPILER_H
-#define _ASM_COMPILER_H
-
-#define GCC_OFF_SMALL_ASM() "ZC"
-
-#define LOONGARCH_ISA_LEVEL "loongarch"
-#define LOONGARCH_ISA_ARCH_LEVEL "arch=loongarch"
-#define LOONGARCH_ISA_LEVEL_RAW loongarch
-#define LOONGARCH_ISA_ARCH_LEVEL_RAW LOONGARCH_ISA_LEVEL_RAW
-
-#endif /* _ASM_COMPILER_H */
index 837659335fb1510da7c6aaee87a9fc7877b9f70c..feb6658c84ff8b04e18a684ee9cddca18bfb1c33 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/futex.h>
 #include <linux/uaccess.h>
 #include <asm/barrier.h>
-#include <asm/compiler.h>
 #include <asm/errno.h>
 
 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)             \
@@ -95,8 +94,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newv
        "       "__UA_ADDR "\t1b, 4b                            \n"
        "       "__UA_ADDR "\t2b, 4b                            \n"
        "       .previous                                       \n"
-       : "+r" (ret), "=&r" (val), "=" GCC_OFF_SMALL_ASM() (*uaddr)
-       : GCC_OFF_SMALL_ASM() (*uaddr), "Jr" (oldval), "Jr" (newval),
+       : "+r" (ret), "=&r" (val), "=ZC" (*uaddr)
+       : "ZC" (*uaddr), "Jr" (oldval), "Jr" (newval),
          "i" (-EFAULT)
        : "memory", "t0");
 
index 52121cd791fe1a0081e38829fef5cb8ff8ae514d..319a8c616f1f5b60097c30a24f9f24682b9282cc 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/compiler.h>
 #include <linux/stringify.h>
-#include <asm/compiler.h>
 #include <asm/loongarch.h>
 
 static inline void arch_local_irq_enable(void)
index 2052a2267337d7bb1d3628e040ae3010e39e9d94..65fbbae9fc4da7b82f02d97499b40285491a2f44 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/bitops.h>
 #include <linux/atomic.h>
 #include <asm/cmpxchg.h>
-#include <asm/compiler.h>
 
 typedef struct {
        atomic_long_t a;
index 2b86469e471859ad0f1c595ce460e675a41d6924..800c965a17eaa81dc5b5d94064e7df5a802c4b1f 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/console.h>
 
 #include <acpi/reboot.h>
-#include <asm/compiler.h>
 #include <asm/idle.h>
 #include <asm/loongarch.h>
 #include <asm/reboot.h>
index 5d856694fcfe1091784959a89386a10fb2b90375..831d4761f385a48dc59041baed79025b111d5c49 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/smp.h>
 #include <linux/timex.h>
 
-#include <asm/compiler.h>
 #include <asm/processor.h>
 
 void __delay(unsigned long cycles)