History

LoongArch: Remove useless header compiler.h

The content of LoongArch's compiler.h is trivial, with some unused anywhere, so inline the definitions and remove the header.

Jun Yi committed 4 years ago

Commit f62b7621 parent ab6e57a8 files · +6 −32Browse files

Unified · Split

8 files
  1. arch/loongarch/Kconfig +0 −1
  2. arch/loongarch/include/asm/atomic.h +4 −9
  3. arch/loongarch/include/asm/compiler.h +0 −15
  4. arch/loongarch/include/asm/futex.h +2 −3
  5. arch/loongarch/include/asm/irqflags.h +0 −1
  6. arch/loongarch/include/asm/local.h +0 −1
  7. arch/loongarch/kernel/reset.c +0 −1
  8. arch/loongarch/lib/delay.c +0 −1
arch/loongarch/Kconfig+0−1
@@ -69,7 +69,6 @@ config LOONGARCH · 68 unmodified lines
69 select GENERIC_TIME_VSYSCALL69 select GENERIC_TIME_VSYSCALL
70 select GPIOLIB70 select GPIOLIB
71 select HAVE_ARCH_AUDITSYSCALL71 select HAVE_ARCH_AUDITSYSCALL
72 select HAVE_ARCH_COMPILER_H
73 select HAVE_ARCH_MMAP_RND_BITS if MMU72 select HAVE_ARCH_MMAP_RND_BITS if MMU
74 select HAVE_ARCH_SECCOMP_FILTER73 select HAVE_ARCH_SECCOMP_FILTER
75 select HAVE_ARCH_TRACEHOOK74 select HAVE_ARCH_TRACEHOOK
arch/loongarch/include/asm/atomic.h+4−9
@@ -10,7 +10,6 @@ · 9 unmodified lines
10#include <linux/types.h>10#include <linux/types.h>
11#include <asm/barrier.h>11#include <asm/barrier.h>
12#include <asm/cmpxchg.h>12#include <asm/cmpxchg.h>
13#include <asm/compiler.h>
14 13
15#if __SIZEOF_LONG__ == 414#if __SIZEOF_LONG__ == 4
16#define __LL "ll.w "15#define __LL "ll.w "
@@ -163,8 +162,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v) · 146 unmodified lines
163 " beqz %1, 1b \n"162 " beqz %1, 1b \n"
164 "2: \n"163 "2: \n"
165 __WEAK_LLSC_MB164 __WEAK_LLSC_MB
166 : "=&r" (result), "=&r" (temp),165 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
167 "+" GCC_OFF_SMALL_ASM() (v->counter)
168 : "I" (-i));166 : "I" (-i));
169 } else {167 } else {
170 __asm__ __volatile__(168 __asm__ __volatile__(
@@ -176,8 +174,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v) · 5 unmodified lines
176 " beqz %1, 1b \n"174 " beqz %1, 1b \n"
177 "2: \n"175 "2: \n"
178 __WEAK_LLSC_MB176 __WEAK_LLSC_MB
179 : "=&r" (result), "=&r" (temp),177 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
180 "+" GCC_OFF_SMALL_ASM() (v->counter)
181 : "r" (i));178 : "r" (i));
182 }179 }
183 180
@@ -326,8 +323,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v) · 142 unmodified lines
326 " beqz %1, 1b \n"323 " beqz %1, 1b \n"
327 "2: \n"324 "2: \n"
328 __WEAK_LLSC_MB325 __WEAK_LLSC_MB
329 : "=&r" (result), "=&r" (temp),326 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
330 "+" GCC_OFF_SMALL_ASM() (v->counter)
331 : "I" (-i));327 : "I" (-i));
332 } else {328 } else {
333 __asm__ __volatile__(329 __asm__ __volatile__(
@@ -339,8 +335,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v) · 5 unmodified lines
339 " beqz %1, 1b \n"335 " beqz %1, 1b \n"
340 "2: \n"336 "2: \n"
341 __WEAK_LLSC_MB337 __WEAK_LLSC_MB
342 : "=&r" (result), "=&r" (temp),338 : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
343 "+" GCC_OFF_SMALL_ASM() (v->counter)
344 : "r" (i));339 : "r" (i));
345 }340 }
346 341
arch/loongarch/include/asm/compiler.h+0−15
@@ -1,15 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
4 */
5#ifndef _ASM_COMPILER_H
6#define _ASM_COMPILER_H
7
8#define GCC_OFF_SMALL_ASM() "ZC"
9
10#define LOONGARCH_ISA_LEVEL "loongarch"
11#define LOONGARCH_ISA_ARCH_LEVEL "arch=loongarch"
12#define LOONGARCH_ISA_LEVEL_RAW loongarch
13#define LOONGARCH_ISA_ARCH_LEVEL_RAW LOONGARCH_ISA_LEVEL_RAW
14
15#endif /* _ASM_COMPILER_H */
arch/loongarch/include/asm/futex.h+2−3
@@ -8,7 +8,6 @@ · 7 unmodified lines
8#include <linux/futex.h>8#include <linux/futex.h>
9#include <linux/uaccess.h>9#include <linux/uaccess.h>
10#include <asm/barrier.h>10#include <asm/barrier.h>
11#include <asm/compiler.h>
12#include <asm/errno.h>11#include <asm/errno.h>
13 12
14#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \13#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 · 80 unmodified lines
95 " "__UA_ADDR "\t1b, 4b \n"94 " "__UA_ADDR "\t1b, 4b \n"
96 " "__UA_ADDR "\t2b, 4b \n"95 " "__UA_ADDR "\t2b, 4b \n"
97 " .previous \n"96 " .previous \n"
98 : "+r" (ret), "=&r" (val), "=" GCC_OFF_SMALL_ASM() (*uaddr)97 : "+r" (ret), "=&r" (val), "=ZC" (*uaddr)
99 : GCC_OFF_SMALL_ASM() (*uaddr), "Jr" (oldval), "Jr" (newval),98 : "ZC" (*uaddr), "Jr" (oldval), "Jr" (newval),
100 "i" (-EFAULT)99 "i" (-EFAULT)
101 : "memory", "t0");100 : "memory", "t0");
102 101
arch/loongarch/include/asm/irqflags.h+0−1
@@ -9,7 +9,6 @@ · 8 unmodified lines
9 9
10#include <linux/compiler.h>10#include <linux/compiler.h>
11#include <linux/stringify.h>11#include <linux/stringify.h>
12#include <asm/compiler.h>
13#include <asm/loongarch.h>12#include <asm/loongarch.h>
14 13
15static inline void arch_local_irq_enable(void)14static inline void arch_local_irq_enable(void)
arch/loongarch/include/asm/local.h+0−1
@@ -9,7 +9,6 @@ · 8 unmodified lines
9#include <linux/bitops.h>9#include <linux/bitops.h>
10#include <linux/atomic.h>10#include <linux/atomic.h>
11#include <asm/cmpxchg.h>11#include <asm/cmpxchg.h>
12#include <asm/compiler.h>
13 12
14typedef struct {13typedef struct {
15 atomic_long_t a;14 atomic_long_t a;
arch/loongarch/kernel/reset.c+0−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
13#include <linux/console.h>13#include <linux/console.h>
14 14
15#include <acpi/reboot.h>15#include <acpi/reboot.h>
16#include <asm/compiler.h>
17#include <asm/idle.h>16#include <asm/idle.h>
18#include <asm/loongarch.h>17#include <asm/loongarch.h>
19#include <asm/reboot.h>18#include <asm/reboot.h>
arch/loongarch/lib/delay.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
7#include <linux/smp.h>7#include <linux/smp.h>
8#include <linux/timex.h>8#include <linux/timex.h>
9 9
10#include <asm/compiler.h>
11#include <asm/processor.h>10#include <asm/processor.h>
12 11
13void __delay(unsigned long cycles)12void __delay(unsigned long cycles)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t