Commit 287d1633 authored by Thomas Huth's avatar Thomas Huth Committed by Catalin Marinas
Browse files

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: default avatarThomas Huth <thuth@redhat.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 639f08fc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#error "cpucaps have overflown ARM64_CB_BIT"
#endif

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

#include <linux/stringify.h>

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

#endif  /*  __ASSEMBLY__  */
#endif  /*  __ASSEMBLER__  */

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

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

#include <linux/types.h>

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

#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */

#endif /* __ASM_ALTERNATIVE_MACROS_H */
+2 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

#include <asm/alternative-macros.h>

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

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

#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* __ASM_ALTERNATIVE_H */
+2 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@

#include <asm/sysreg.h>

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

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

#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */
#endif /* __ASM_ARCH_GICV3_H */
+3 −3
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
/* Data fields for EX_TYPE_UACCESS_CPY */
#define EX_DATA_UACCESS_WRITE	BIT(0)

#ifdef __ASSEMBLY__
#ifdef __ASSEMBLER__

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

#else /* __ASSEMBLY__ */
#else /* __ASSEMBLER__ */

#include <linux/stringify.h>

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

#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLER__ */

#endif /* __ASM_ASM_EXTABLE_H */
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 * Copyright (C) 1996-2000 Russell King
 * Copyright (C) 2012 ARM Ltd.
 */
#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__
#error "Only include this from assembly code"
#endif

Loading