Skip to content

Commit 287d163

Browse files
huthctmarinas
authored andcommitted
arm64: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize now on the __ASSEMBLER__ macro that is provided by the compilers. This is a mostly mechanical patch (done with a simple "sed -i" statement), except for the following files where comments with mis-spelled macros were tweaked manually: arch/arm64/include/asm/stacktrace/frame.h arch/arm64/include/asm/kvm_ptrauth.h arch/arm64/include/asm/debug-monitors.h arch/arm64/include/asm/esr.h arch/arm64/include/asm/scs.h arch/arm64/include/asm/memory.h Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 639f08f commit 287d163

66 files changed

Lines changed: 136 additions & 136 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/arm64/include/asm/alternative-macros.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#error "cpucaps have overflown ARM64_CB_BIT"
2020
#endif
2121

22-
#ifndef __ASSEMBLY__
22+
#ifndef __ASSEMBLER__
2323

2424
#include <linux/stringify.h>
2525

@@ -207,7 +207,7 @@ alternative_endif
207207
#define _ALTERNATIVE_CFG(insn1, insn2, cap, cfg, ...) \
208208
alternative_insn insn1, insn2, cap, IS_ENABLED(cfg)
209209

210-
#endif /* __ASSEMBLY__ */
210+
#endif /* __ASSEMBLER__ */
211211

212212
/*
213213
* Usage: asm(ALTERNATIVE(oldinstr, newinstr, cpucap));
@@ -219,7 +219,7 @@ alternative_endif
219219
#define ALTERNATIVE(oldinstr, newinstr, ...) \
220220
_ALTERNATIVE_CFG(oldinstr, newinstr, __VA_ARGS__, 1)
221221

222-
#ifndef __ASSEMBLY__
222+
#ifndef __ASSEMBLER__
223223

224224
#include <linux/types.h>
225225

@@ -263,6 +263,6 @@ alternative_has_cap_unlikely(const unsigned long cpucap)
263263
return true;
264264
}
265265

266-
#endif /* __ASSEMBLY__ */
266+
#endif /* __ASSEMBLER__ */
267267

268268
#endif /* __ASM_ALTERNATIVE_MACROS_H */

arch/arm64/include/asm/alternative.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <asm/alternative-macros.h>
66

7-
#ifndef __ASSEMBLY__
7+
#ifndef __ASSEMBLER__
88

99
#include <linux/init.h>
1010
#include <linux/types.h>
@@ -34,5 +34,5 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
3434
void alt_cb_patch_nops(struct alt_instr *alt, __le32 *origptr,
3535
__le32 *updptr, int nr_inst);
3636

37-
#endif /* __ASSEMBLY__ */
37+
#endif /* __ASSEMBLER__ */
3838
#endif /* __ASM_ALTERNATIVE_H */

arch/arm64/include/asm/arch_gicv3.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include <asm/sysreg.h>
1111

12-
#ifndef __ASSEMBLY__
12+
#ifndef __ASSEMBLER__
1313

1414
#include <linux/irqchip/arm-gic-common.h>
1515
#include <linux/stringify.h>
@@ -188,5 +188,5 @@ static inline bool gic_has_relaxed_pmr_sync(void)
188188
return cpus_have_cap(ARM64_HAS_GIC_PRIO_RELAXED_SYNC);
189189
}
190190

191-
#endif /* __ASSEMBLY__ */
191+
#endif /* __ASSEMBLER__ */
192192
#endif /* __ASM_ARCH_GICV3_H */

arch/arm64/include/asm/asm-extable.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/* Data fields for EX_TYPE_UACCESS_CPY */
2828
#define EX_DATA_UACCESS_WRITE BIT(0)
2929

30-
#ifdef __ASSEMBLY__
30+
#ifdef __ASSEMBLER__
3131

3232
#define __ASM_EXTABLE_RAW(insn, fixup, type, data) \
3333
.pushsection __ex_table, "a"; \
@@ -77,7 +77,7 @@
7777
__ASM_EXTABLE_RAW(\insn, \fixup, EX_TYPE_UACCESS_CPY, \uaccess_is_write)
7878
.endm
7979

80-
#else /* __ASSEMBLY__ */
80+
#else /* __ASSEMBLER__ */
8181

8282
#include <linux/stringify.h>
8383

@@ -132,6 +132,6 @@
132132
EX_DATA_REG(ADDR, addr) \
133133
")")
134134

135-
#endif /* __ASSEMBLY__ */
135+
#endif /* __ASSEMBLER__ */
136136

137137
#endif /* __ASM_ASM_EXTABLE_H */

arch/arm64/include/asm/assembler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Copyright (C) 1996-2000 Russell King
66
* Copyright (C) 2012 ARM Ltd.
77
*/
8-
#ifndef __ASSEMBLY__
8+
#ifndef __ASSEMBLER__
99
#error "Only include this from assembly code"
1010
#endif
1111

arch/arm64/include/asm/barrier.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef __ASM_BARRIER_H
88
#define __ASM_BARRIER_H
99

10-
#ifndef __ASSEMBLY__
10+
#ifndef __ASSEMBLER__
1111

1212
#include <linux/kasan-checks.h>
1313

@@ -221,6 +221,6 @@ do { \
221221

222222
#include <asm-generic/barrier.h>
223223

224-
#endif /* __ASSEMBLY__ */
224+
#endif /* __ASSEMBLER__ */
225225

226226
#endif /* __ASM_BARRIER_H */

arch/arm64/include/asm/cache.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define ARCH_DMA_MINALIGN (128)
3636
#define ARCH_KMALLOC_MINALIGN (8)
3737

38-
#if !defined(__ASSEMBLY__) && !defined(BUILD_VDSO)
38+
#if !defined(__ASSEMBLER__) && !defined(BUILD_VDSO)
3939

4040
#include <linux/bitops.h>
4141
#include <linux/kasan-enabled.h>
@@ -135,6 +135,6 @@ static inline u32 __attribute_const__ read_cpuid_effective_cachetype(void)
135135
return ctr;
136136
}
137137

138-
#endif /* !defined(__ASSEMBLY__) && !defined(BUILD_VDSO) */
138+
#endif /* !defined(__ASSEMBLER__) && !defined(BUILD_VDSO) */
139139

140140
#endif

arch/arm64/include/asm/cpucaps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <asm/cpucap-defs.h>
77

8-
#ifndef __ASSEMBLY__
8+
#ifndef __ASSEMBLER__
99
#include <linux/types.h>
1010
/*
1111
* Check whether a cpucap is possible at compiletime.
@@ -77,6 +77,6 @@ cpucap_is_possible(const unsigned int cap)
7777

7878
return true;
7979
}
80-
#endif /* __ASSEMBLY__ */
80+
#endif /* __ASSEMBLER__ */
8181

8282
#endif /* __ASM_CPUCAPS_H */

arch/arm64/include/asm/cpufeature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define ARM64_SW_FEATURE_OVERRIDE_HVHE 4
2020
#define ARM64_SW_FEATURE_OVERRIDE_RODATA_OFF 8
2121

22-
#ifndef __ASSEMBLY__
22+
#ifndef __ASSEMBLER__
2323

2424
#include <linux/bug.h>
2525
#include <linux/jump_label.h>
@@ -1078,6 +1078,6 @@ static inline bool cpu_has_lpa2(void)
10781078
#endif
10791079
}
10801080

1081-
#endif /* __ASSEMBLY__ */
1081+
#endif /* __ASSEMBLER__ */
10821082

10831083
#endif

arch/arm64/include/asm/cputype.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
#define MIDR_FUJITSU_ERRATUM_010001_MASK (~MIDR_CPU_VAR_REV(1, 0))
250250
#define TCR_CLEAR_FUJITSU_ERRATUM_010001 (TCR_NFD1 | TCR_NFD0)
251251

252-
#ifndef __ASSEMBLY__
252+
#ifndef __ASSEMBLER__
253253

254254
#include <asm/sysreg.h>
255255

@@ -328,6 +328,6 @@ static inline u32 __attribute_const__ read_cpuid_cachetype(void)
328328
{
329329
return read_cpuid(CTR_EL0);
330330
}
331-
#endif /* __ASSEMBLY__ */
331+
#endif /* __ASSEMBLER__ */
332332

333333
#endif

0 commit comments

Comments
 (0)