treewide: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
Subsystems (37)
v5 cover treewide: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
The kernel Makefiles define the __ASSEMBLY__ macro to provide a way to use headers in both, assembly and C source code. However, all the supported versions of the GCC and Clang compilers (and also other compilers like Tiny-C or PCC) define the macro __ASSEMBLER__ automatically already when compiling assembly code, too, so some kernel headers are using __ASSEMBLER__ instead. With regards to userspace code, this seems also to be constant source of confusion, see for example these links here:
https://lore.kernel.org/kvm/[email protected]/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199
To avoid confusion in the future, it makes sense to standardize on the macro that gets defined by the compiler, so this patch series changes all occurrences of __ASSEMBLY__ into __ASSEMBLER__ and finally removes the -D__ASSEMBLY__ from the Makefiles.
I split the patches per architecture / maintained subsystem to ease the review, and I also split the uapi headers from the normal ones in case we ever decide that uapi needs to be treated differently from the normal headers here and the patches would need to get reverted.
v5:
- To ease the review, I split some huge patches into smaller patches when there was a separate entry for the files in the MAINTAINERS file
- Dropped the patches that were already merged
- Rebased the patches to the current master branch and fixed new occurrences of __ASSEMBLY__
Thomas Huth (13):
of: fdt: Replace __ASSEMBLY__ with __ASSEMBLER__ in of_fdt.h header
file
smccc: Replace __ASSEMBLY__ with __ASSEMBLER__
ARM: PXA: Replace __ASSEMBLY__ with __ASSEMBLER__
ARM: BCM7XXX: Replace __ASSEMBLY__ with __ASSEMBLER__
arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in ptrace uapi header
arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
uapi: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi
headers
include: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
treewide: Stop defining __ASSEMBLY__ for assembler files
Documentation/dev-tools/checkuapi.rst | 2 +- Makefile | 2 +- arch/alpha/boot/compressed/Makefile | 2 +- arch/arm/include/asm/assembler.h | 2 +- arch/arm/include/asm/barrier.h | 4 ++-- arch/arm/include/asm/cache.h | 2 +- arch/arm/include/asm/cp15.h | 4 ++-- arch/arm/include/asm/cputype.h | 4 ++-- arch/arm/include/asm/current.h | 4 ++-- arch/arm/include/asm/delay.h | 4 ++-- arch/arm/include/asm/domain.h | 8 ++++---- arch/arm/include/asm/fpstate.h | 2 +- arch/arm/include/asm/ftrace.h | 6 +++--- arch/arm/include/asm/hardware/cache-b15-rac.h | 2 +- arch/arm/include/asm/hardware/cache-l2x0.h | 4 ++-- arch/arm/include/asm/hardware/dec21285.h | 2 +- arch/arm/include/asm/hardware/ioc.h | 2 +- arch/arm/include/asm/hardware/iomd.h | 4 ++-- arch/arm/include/asm/hardware/memc.h | 2 +- arch/arm/include/asm/hwcap.h | 2 +- arch/arm/include/asm/irq.h | 2 +- arch/arm/include/asm/kexec.h | 4 ++-- arch/arm/include/asm/kgdb.h | 4 ++-- arch/arm/include/asm/linkage.h | 4 ++-- arch/arm/include/asm/mach/arch.h | 2 +- arch/arm/include/asm/mcpm.h | 4 ++-- arch/arm/include/asm/memory.h | 4 ++-- arch/arm/include/asm/mpu.h | 4 ++-- arch/arm/include/asm/opcodes.h | 12 ++++++------ arch/arm/include/asm/page.h | 4 ++-- arch/arm/include/asm/pgtable-2level.h | 4 ++-- arch/arm/include/asm/pgtable-3level.h | 4 ++-- arch/arm/include/asm/pgtable-nommu.h | 4 ++-- arch/arm/include/asm/pgtable.h | 8 ++++---- arch/arm/include/asm/probes.h | 4 ++-- arch/arm/include/asm/proc-fns.h | 4 ++-- arch/arm/include/asm/ptrace.h | 4 ++-- arch/arm/include/asm/system_info.h | 4 ++-- arch/arm/include/asm/system_misc.h | 4 ++-- arch/arm/include/asm/thread_info.h | 2 +- arch/arm/include/asm/thread_notify.h | 2 +- arch/arm/include/asm/tlbflush.h | 10 +++++----- arch/arm/include/asm/tls.h | 4 ++-- arch/arm/include/asm/unified.h | 6 +++--- arch/arm/include/asm/unwind.h | 4 ++-- arch/arm/include/asm/v7m.h | 4 ++-- arch/arm/include/asm/vdso.h | 4 ++-- arch/arm/include/asm/vdso/cp15.h | 4 ++-- arch/arm/include/asm/vdso/gettimeofday.h | 4 ++-- arch/arm/include/asm/vdso/processor.h | 4 ++-- arch/arm/include/asm/vfp.h | 2 +- arch/arm/include/asm/virt.h | 4 ++-- arch/arm/include/uapi/asm/ptrace.h | 4 ++-- .../mach-footbridge/include/mach/hardware.h | 2 +- arch/arm/mach-pxa/irqs.h | 2 +- arch/arm/mach-pxa/pxa-regs.h | 2 +- arch/arm/mach-sa1100/include/mach/bitfield.h | 2 +- arch/arm/mach-sa1100/include/mach/hardware.h | 2 +- arch/arm/tools/gen-mach-types | 2 +- arch/arm64/kernel/vdso32/Makefile | 1 - arch/hexagon/include/asm/hexagon_vm.h | 4 ++-- arch/hexagon/include/asm/mem-layout.h | 6 +++--- arch/hexagon/include/asm/page.h | 4 ++-- arch/hexagon/include/asm/processor.h | 4 ++-- arch/hexagon/include/asm/thread_info.h | 12 ++++++------ arch/hexagon/include/uapi/asm/registers.h | 4 ++-- arch/loongarch/vdso/Makefile | 2 +- arch/mips/boot/compressed/Makefile | 2 +- arch/mips/vdso/Makefile | 2 +- arch/powerpc/boot/Makefile | 2 +- arch/powerpc/platforms/cell/spufs/Makefile | 2 +- arch/s390/Makefile | 2 +- arch/x86/boot/Makefile | 2 +- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/realmode/rm/Makefile | 2 +- arch/xtensa/kernel/Makefile | 2 +- drivers/firmware/efi/libstub/Makefile | 2 +- drivers/net/wan/Makefile | 2 +- include/asm-generic/barrier.h | 4 ++-- include/asm-generic/bug.h | 4 ++-- include/asm-generic/current.h | 2 +- include/asm-generic/error-injection.h | 2 +- include/asm-generic/int-ll64.h | 6 +++--- include/asm-generic/rwonce.h | 4 ++-- include/asm-generic/signal.h | 4 ++-- include/linux/amba/serial.h | 4 ++-- include/linux/annotate.h | 18 +++++++++--------- include/linux/arm-smccc.h | 10 +++++----- include/linux/cfi_types.h | 6 +++--- include/linux/compiler.h | 4 ++-- include/linux/compiler_types.h | 8 ++++---- include/linux/edd.h | 4 ++-- include/linux/err.h | 2 +- include/linux/export.h | 2 +- include/linux/init.h | 6 +++--- include/linux/ioport.h | 4 ++-- include/linux/linkage.h | 6 +++--- include/linux/mem_encrypt.h | 4 ++-- include/linux/of_fdt.h | 4 ++-- include/linux/pe.h | 4 ++-- include/linux/platform_data/emif_plat.h | 4 ++-- include/linux/ti-emif-sram.h | 2 +- include/linux/types.h | 4 ++-- include/uapi/asm-generic/int-l64.h | 4 ++-- include/uapi/asm-generic/int-ll64.h | 4 ++-- include/uapi/asm-generic/signal-defs.h | 2 +- include/uapi/asm-generic/signal.h | 4 ++-- include/uapi/linux/a.out.h | 4 ++-- include/uapi/linux/const.h | 4 ++-- include/uapi/linux/edd.h | 4 ++-- include/uapi/linux/hdlc/ioctl.h | 4 ++-- include/uapi/linux/types.h | 4 ++-- scripts/Makefile.build | 2 +- scripts/gfp-translate | 2 +- scripts/headers_install.sh | 1 - .../tests/cmd_graph/test_savedcmd_parser.py | 2 +- tools/include/asm-generic/barrier.h | 4 ++-- tools/include/asm/alternative.h | 2 +- tools/include/linux/cfi_types.h | 6 +++--- tools/include/linux/compiler.h | 4 ++-- tools/include/uapi/linux/const.h | 4 ++-- .../testing/selftests/kvm/lib/riscv/handlers.S | 4 ---- .../testing/selftests/vDSO/vgetrandom-chacha.S | 2 -- 123 files changed, 229 insertions(+), 237 deletions(-)
Signature · 1 line
2.56.0
PATCH v5 2/13 smccc: Replace __ASSEMBLY__ with __ASSEMBLER__
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.
--- include/linux/arm-smccc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
include/linux/arm-smccc.h +5 -5
@@ -8,7 +8,7 @@#include <linux/args.h> #include <linux/init.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/uuid.h> #endif
@@ -313,7 +313,7 @@#define SMCCC_RET_NOT_REQUIRED -2#define SMCCC_RET_INVALID_PARAMETER -3 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/linkage.h> #include <linux/types.h>
@@ -364,7 +364,7 @@ s32 arm_smccc_get_soc_id_version(void);*/ s32 arm_smccc_get_soc_id_revision (void ); -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Returns whether a specific hypervisor UUID is advertised for the
@@ -413,7 +413,7 @@ static inline u32 smccc_uuid_to_reg(const uuid_t *uuid, int reg) return val; } -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ /** * struct arm_smccc_res - Result from SMC/HVC call
@@ -761,5 +761,5 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, })#endif /*CONFIG_ARM64*/ -#endif /*__ASSEMBLY__*/ +#endif /*__ASSEMBLER__*/ #endif /*__LINUX_ARM_SMCCC_H*/
Signature · 1 line
2.56.0
PATCH v5 3/13 ARM: PXA: Replace __ASSEMBLY__ with __ASSEMBLER__
In reply to Thomas HuthWhile the GCC and Clang compilers already define __ASSEMBLER__ auto- matically 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. Let's standardize now on the __ASSEMBLER__ macro to avoid this confusion.
--- arch/arm/mach-pxa/irqs.h | 2 +- arch/arm/mach-pxa/pxa-regs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-pxa/irqs.h +1 -1
@@ -94,7 +94,7 @@#define PXA_NR_IRQS (IRQ_BOARD_START) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__struct irq_data ;struct pt_regs ;
arch/arm/mach-pxa/pxa-regs.h +1 -1
@@ -31,7 +31,7 @@#define io_v2p (x) (0x3c000000 + ((x) & 0x01ffffff) + (((x) & 0x0e000000) << 1))#define io_p2v (x) IOMEM(0xf2000000 + ((x) & 0x01ffffff) + (((x) & 0x1c000000) >> 1)) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__# define __REG (x) (*((volatile u32 __iomem *)io_p2v(x)))/* With indexed regs we don't want to feed the index through io_p2v()
Signature · 1 line
2.56.0
PATCH v5 1/13 of: fdt: Replace __ASSEMBLY__ with __ASSEMBLER__ in of_fdt.h header file
In reply to Thomas HuthWhile 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.
--- include/linux/of_fdt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/of_fdt.h +2 -2
@@ -16,7 +16,7 @@/* Definitions used by the flattened device tree */ #define OF_DT_HEADER 0xd00dfeed/* marker */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#if defined(CONFIG_OF_FLATTREE )
@@ -103,5 +103,5 @@ static inline void unflatten_device_tree(void) {}static inline void unflatten_and_copy_device_tree (void ) {}#endif /* CONFIG_OF_EARLY_FLATTREE */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_OF_FDT_H */
Signature · 1 line
2.56.0
PATCH v5 5/13 arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in ptrace uapi header
In reply to Thomas Huth__ASSEMBLY__ is only defined by the Makefile of the kernel, so this is not really useful for uapi headers (unless the userspace Makefile defines it, too). Let's switch to __ASSEMBLER__ which gets set automatically by the compiler when compiling assembly code.
--- arch/arm/include/uapi/asm/ptrace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/include/uapi/asm/ptrace.h +2 -2
@@ -110,7 +110,7 @@#define PT_DATA_ADDR 0x10004#define PT_TEXT_END_ADDR 0x10008 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * This struct defines the way the registers are stored on the
@@ -149,6 +149,6 @@ struct pt_regs { #define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ ) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI__ASM_ARM_PTRACE_H */
Signature · 1 line
2.56.0
PATCH v5 4/13 ARM: BCM7XXX: Replace __ASSEMBLY__ with __ASSEMBLER__
In reply to Thomas HuthWhile the GCC and Clang compilers already define __ASSEMBLER__ auto- matically 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. Let's standardize now on the __ASSEMBLER__ macro to avoid this confusion.
--- arch/arm/include/asm/hardware/cache-b15-rac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/hardware/cache-b15-rac.h +1 -1
@@ -1,7 +1,7 @@#ifndef __ASM_ARM_HARDWARE_CACHE_B15_RAC_H#define __ASM_ARM_HARDWARE_CACHE_B15_RAC_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__void b15_flush_kern_cache_all (void );
Signature · 1 line
2.56.0
PATCH v5 7/13 hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
In reply to Thomas Huth__ASSEMBLY__ is only defined by the Makefile of the kernel, so this is not really useful for uapi headers (unless the userspace Makefile defines it, too). Let's switch to __ASSEMBLER__ which gets set automatically by the compiler when compiling assembly code.
--- arch/hexagon/include/uapi/asm/registers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/hexagon/include/uapi/asm/registers.h +2 -2
@@ -7,7 +7,7 @@#ifndef _ASM_REGISTERS_H#define _ASM_REGISTERS_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* See kernel/entry.S for further documentation. */
@@ -224,6 +224,6 @@ struct pt_regs { (regs)->hvmer.vmest = (HVM_VMEST_UM_MSK <<HVM_VMEST_UM_SFT ) \ | (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT) -#endif /* ifndef __ASSEMBLY */ +#endif /* ifndef __ASSEMBLER__ */ #endif
Signature · 1 line
2.56.0
PATCH v5 8/13 hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
In reply to Thomas HuthWhile 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.
--- arch/hexagon/include/asm/hexagon_vm.h | 4 ++-- arch/hexagon/include/asm/mem-layout.h | 6 +++--- arch/hexagon/include/asm/page.h | 4 ++-- arch/hexagon/include/asm/processor.h | 4 ++-- arch/hexagon/include/asm/thread_info.h | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-)
arch/hexagon/include/asm/hexagon_vm.h +2 -2
@@ -39,7 +39,7 @@#define HVM_TRAP1_VMGETREGS 22#define HVM_TRAP1_VMTIMEROP 24 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__enum VM_CACHE_OPS { hvmc_ickill,
@@ -178,7 +178,7 @@ static inline long __vmintop_clear(long i)#else /* Only assembly code should reference these */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * Constants for virtual instruction parameters and return values
arch/hexagon/include/asm/mem-layout.h +3 -3
@@ -25,7 +25,7 @@*/ #ifdef CONFIG_HEXAGON_PHYS_OFFSET -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern unsigned long __phys_offset;#endif #define PHYS_OFFSET __phys_offset
@@ -44,7 +44,7 @@ extern unsigned long __phys_offset;#define STACK_TOP TASK_SIZE#define STACK_TOP_MAX TASK_SIZE -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__enum fixed_addresses {FIX_KMAP_BEGIN , FIX_KMAP_END, /* check for per-cpuism */
@@ -101,7 +101,7 @@ extern int max_kernel_seg;* and pkmap_base begins. */ #define VMALLOC_END (PKMAP_BASE-PAGE_SIZE*2) -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* _ASM_HEXAGON_MEM_LAYOUT_H */
arch/hexagon/include/asm/page.h +2 -2
@@ -48,7 +48,7 @@#include <vdso/page.h> #ifdef __KERNEL__ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * This is for PFN_DOWN, which mm.h needs. Seems the right place to pull it in.
@@ -127,7 +127,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr)/* XXX Todo: implement assembly-optimized version of getorder. */ #include <asm-generic/getorder.h> -#endif /* ifdef __ASSEMBLY__ */ +#endif /* ifdef __ASSEMBLER__ */ #endif /* ifdef __KERNEL__ */ #endif
arch/hexagon/include/asm/processor.h +2 -2
@@ -8,7 +8,7 @@#ifndef _ASM_PROCESSOR_H#define _ASM_PROCESSOR_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/mem-layout.h> #include <asm/registers.h>
@@ -124,6 +124,6 @@ struct hexagon_switch_stack {unsigned long lr; }; -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif
arch/hexagon/include/asm/thread_info.h +6 -6
@@ -10,7 +10,7 @@#ifdef __KERNEL__ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/processor.h> #include <asm/registers.h> #include <asm/page.h>
@@ -20,7 +20,7 @@#define THREAD_SIZE (1<<THREAD_SHIFT)#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * This is union'd with the "bottom" of the kernel stack.
@@ -47,13 +47,13 @@ struct thread_info {unsigned long sp; }; -#else /* !__ASSEMBLY__ */ +#else /* !__ASSEMBLER__ */ #include <asm/asm-offsets.h> -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define INIT_THREAD_INFO (tsk) \ { \
@@ -73,7 +73,7 @@ struct thread_info { register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);#define current_thread_info () __current_thread_info -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * thread information flags
Signature · 1 line
2.56.0
PATCH v5 9/13 asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
In reply to Thomas Huth__ASSEMBLY__ is only defined by the Makefile of the kernel, so this is not really useful for uapi headers (unless the userspace Makefile defines it, too). Let's switch to __ASSEMBLER__ which gets set automatically by the compiler when compiling assembly code.
--- include/uapi/asm-generic/int-l64.h | 4 ++-- include/uapi/asm-generic/int-ll64.h | 4 ++-- include/uapi/asm-generic/signal-defs.h | 2 +- include/uapi/asm-generic/signal.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
include/uapi/asm-generic/int-l64.h +2 -2
@@ -11,7 +11,7 @@#include <asm/bitsperlong.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space
@@ -29,7 +29,7 @@ typedef unsigned int __u32;typedef __signed__ long __s64 ;typedef unsigned long __u64 ; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI_ASM_GENERIC_INT_L64_H */
include/uapi/asm-generic/int-ll64.h +2 -2
@@ -11,7 +11,7 @@#include <asm/bitsperlong.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the * header files exported to user space
@@ -34,7 +34,7 @@ typedef __signed__ long long __s64;typedef unsigned long long __u64 ;#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI_ASM_GENERIC_INT_LL64_H */
include/uapi/asm-generic/signal-defs.h +1 -1
@@ -78,7 +78,7 @@#define SIG_SETMASK 2/* for setting the signal mask */ #endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__typedef void __signalfn_t (int );typedef __signalfn_t __user *__sighandler_t ;
include/uapi/asm-generic/signal.h +2 -2
@@ -57,7 +57,7 @@#define SIGSTKSZ 8192#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__typedef struct {unsigned long sig[_NSIG_WORDS]; }sigset_t ;
@@ -88,6 +88,6 @@ typedef struct sigaltstack {__kernel_size_t ss_size; } stack_t; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI__ASM_GENERIC_SIGNAL_H */
Signature · 1 line
2.56.0
PATCH v5 6/13 arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
In reply to Thomas HuthWhile 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 completely mechanical patch (done with a simple "sed -i" statement).
--- arch/arm/include/asm/assembler.h | 2 +- arch/arm/include/asm/barrier.h | 4 ++-- arch/arm/include/asm/cache.h | 2 +- arch/arm/include/asm/cp15.h | 4 ++-- arch/arm/include/asm/cputype.h | 4 ++-- arch/arm/include/asm/current.h | 4 ++-- arch/arm/include/asm/delay.h | 4 ++-- arch/arm/include/asm/domain.h | 8 ++++---- arch/arm/include/asm/fpstate.h | 2 +- arch/arm/include/asm/ftrace.h | 6 +++--- arch/arm/include/asm/hardware/cache-l2x0.h | 4 ++-- arch/arm/include/asm/hardware/dec21285.h | 2 +- arch/arm/include/asm/hardware/ioc.h | 2 +- arch/arm/include/asm/hardware/iomd.h | 4 ++-- arch/arm/include/asm/hardware/memc.h | 2 +- arch/arm/include/asm/hwcap.h | 2 +- arch/arm/include/asm/irq.h | 2 +- arch/arm/include/asm/kexec.h | 4 ++-- arch/arm/include/asm/kgdb.h | 4 ++-- arch/arm/include/asm/linkage.h | 4 ++-- arch/arm/include/asm/mach/arch.h | 2 +- arch/arm/include/asm/mcpm.h | 4 ++-- arch/arm/include/asm/memory.h | 4 ++-- arch/arm/include/asm/mpu.h | 4 ++-- arch/arm/include/asm/opcodes.h | 12 ++++++------ arch/arm/include/asm/page.h | 4 ++-- arch/arm/include/asm/pgtable-2level.h | 4 ++-- arch/arm/include/asm/pgtable-3level.h | 4 ++-- arch/arm/include/asm/pgtable-nommu.h | 4 ++-- arch/arm/include/asm/pgtable.h | 8 ++++---- arch/arm/include/asm/probes.h | 4 ++-- arch/arm/include/asm/proc-fns.h | 4 ++-- arch/arm/include/asm/ptrace.h | 4 ++-- arch/arm/include/asm/system_info.h | 4 ++-- arch/arm/include/asm/system_misc.h | 4 ++-- arch/arm/include/asm/thread_info.h | 2 +- arch/arm/include/asm/thread_notify.h | 2 +- arch/arm/include/asm/tlbflush.h | 10 +++++----- arch/arm/include/asm/tls.h | 4 ++-- arch/arm/include/asm/unified.h | 6 +++--- arch/arm/include/asm/unwind.h | 4 ++-- arch/arm/include/asm/v7m.h | 4 ++-- arch/arm/include/asm/vdso.h | 4 ++-- arch/arm/include/asm/vdso/cp15.h | 4 ++-- arch/arm/include/asm/vdso/gettimeofday.h | 4 ++-- arch/arm/include/asm/vdso/processor.h | 4 ++-- arch/arm/include/asm/vfp.h | 2 +- arch/arm/include/asm/virt.h | 4 ++-- arch/arm/mach-footbridge/include/mach/hardware.h | 2 +- arch/arm/mach-sa1100/include/mach/bitfield.h | 2 +- arch/arm/mach-sa1100/include/mach/hardware.h | 2 +- arch/arm/tools/gen-mach-types | 2 +- 52 files changed, 101 insertions(+), 101 deletions(-)
arch/arm/include/asm/assembler.h +1 -1
@@ -13,7 +13,7 @@#ifndef __ASM_ASSEMBLER_H__#define __ASM_ASSEMBLER_H__ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#error "Only include this from assembly code"#endif
arch/arm/include/asm/barrier.h +2 -2
@@ -2,7 +2,7 @@#ifndef __ASM_BARRIER_H#define __ASM_BARRIER_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define nop () __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
@@ -99,5 +99,5 @@ static inline unsigned long array_index_mask_nospec(unsigned long idx,#include <asm-generic/barrier.h> -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __ASM_BARRIER_H */
arch/arm/include/asm/cache.h +1 -1
@@ -26,7 +26,7 @@#define __read_mostly __section(".data..read_mostly") -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifdef CONFIG_ARCH_HAS_CACHE_LINE_SIZE int cache_line_size (void );#endif
arch/arm/include/asm/cp15.h +2 -2
@@ -40,7 +40,7 @@#define CR_AFE (1 << 29)/* Access flag enable */ #define CR_TE (1 << 30)/* Thumb exception enable */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#if __LINUX_ARM_ARCH__ >=4 #define vectors_high () (get_cr() & CR_V)
@@ -117,6 +117,6 @@ static inline unsigned long get_cr(void)#endif /* ifdef CONFIG_CPU_CP15 / else */ -#endif /* ifndef __ASSEMBLY__ */ +#endif /* ifndef __ASSEMBLER__ */ #endif
arch/arm/include/asm/cputype.h +2 -2
@@ -109,7 +109,7 @@/* Qualcomm implemented cores */ #define ARM_CPU_PART_SCORPION 0x510002d0 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/stringify.h> #include <linux/kernel.h>
@@ -343,6 +343,6 @@ static inline int __attribute_const__ cpuid_feature_extract_field(u32 features,#define cpuid_feature_extract (reg, field) \ cpuid_feature_extract_field(read_cpuid_ext(reg), field) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
arch/arm/include/asm/current.h +2 -2
@@ -7,7 +7,7 @@#ifndef _ASM_ARM_CURRENT_H#define _ASM_ARM_CURRENT_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/insn.h> struct task_struct ;
@@ -60,6 +60,6 @@ static __always_inline __attribute_const__ struct task_struct *get_current(void)#define current get_current() -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_ARM_CURRENT_H */
arch/arm/include/asm/delay.h +2 -2
@@ -41,7 +41,7 @@#define UDELAY_MULT UL(2147 * HZ + 483648 * HZ / 1000000)#define UDELAY_SHIFT 31 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct delay_timer { unsigned long (*read_current_timer)(void);
@@ -93,7 +93,7 @@ extern void __loop_const_udelay(unsigned long);/* Delay-loop timer registration. */ extern void register_current_timer_delay (const struct delay_timer *timer); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* defined(_ARM_DELAY_H) */
arch/arm/include/asm/domain.h +4 -4
@@ -7,7 +7,7 @@#ifndef __ASM_PROC_DOMAIN_H#define __ASM_PROC_DOMAIN_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/thread_info.h> #include <asm/barrier.h> #endif
@@ -62,7 +62,7 @@#define DACR_UACCESS_ENABLE \ (__DACR_DEFAULT | domain_val(DOMAIN_USER, DOMAIN_CLIENT)) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifdef CONFIG_CPU_CP15_MMU static __always_inline unsigned int get_domain(void)
@@ -107,7 +107,7 @@ static __always_inline void set_domain(unsigned int val)#define TUSERCOND (instr, cond) #instr #cond#endif -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ /* * Generate the T (user) versions of the LDR/STR and related
@@ -119,6 +119,6 @@ static __always_inline void set_domain(unsigned int val)#define TUSER (instr) instr#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* !__ASM_PROC_DOMAIN_H */
arch/arm/include/asm/fpstate.h +1 -1
@@ -9,7 +9,7 @@#define __ASM_ARM_FPSTATE_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * VFP storage area has:
arch/arm/include/asm/ftrace.h +3 -3
@@ -12,7 +12,7 @@#define MCOUNT_ADDR ((unsigned long)(__gnu_mcount_nc))#define MCOUNT_INSN_SIZE 4/* sizeof mcount call */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern void __gnu_mcount_nc (void );#ifdef CONFIG_DYNAMIC_FTRACE
@@ -33,7 +33,7 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#if defined(CONFIG_FRAME_POINTER ) && !defined(CONFIG_ARM_UNWIND )/*
@@ -79,6 +79,6 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self,unsigned long frame_pointer, unsigned long stack_pointer); -#endif /* ifndef __ASSEMBLY__ */ +#endif /* ifndef __ASSEMBLER__ */ #endif /* _ASM_ARM_FTRACE */
arch/arm/include/asm/hardware/cache-l2x0.h +2 -2
@@ -147,7 +147,7 @@#define L2X0_WAY_SIZE_SHIFT 3 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern void __init l2x0_init (void __iomem *base,u32 aux_val,u32 aux_mask);#if defined(CONFIG_CACHE_L2X0 ) && defined(CONFIG_OF )extern int l2x0_of_init (u32 aux_val,u32 aux_mask);
@@ -187,6 +187,6 @@ struct l2x0_regs {extern struct l2x0_regs l2x0_saved_regs; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
arch/arm/include/asm/hardware/dec21285.h +1 -1
@@ -15,7 +15,7 @@#define DC21285_PCI_IO 0x7c000000#define DC21285_PCI_MEM 0x80000000 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <mach/hardware.h> #define DC21285_IO (x) ((volatile unsigned long *)(ARMCSR_BASE+(x)))#else
arch/arm/include/asm/hardware/ioc.h +1 -1
@@ -10,7 +10,7 @@#ifndef __ASMARM_HARDWARE_IOC_H#define __ASMARM_HARDWARE_IOC_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * We use __raw_base variants here so that we give the compiler the
arch/arm/include/asm/hardware/iomd.h +2 -2
@@ -11,7 +11,7 @@#define __ASMARM_HARDWARE_IOMD_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * We use __raw_base variants here so that we give the compiler the
@@ -167,7 +167,7 @@#define VDMA_START IOMD_VIDSTART#define VDMA_END IOMD_VIDEND -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern unsigned int vram_half_sam;#define video_set_dma (start,end,offset) \ do { \
arch/arm/include/asm/hardware/memc.h +1 -1
@@ -10,7 +10,7 @@#define VDMA_START 1#define VDMA_END 2 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern void memc_write (unsigned int reg,unsigned long val);#define video_set_dma (start,end,offset) \
arch/arm/include/asm/hwcap.h +1 -1
@@ -4,7 +4,7 @@#include <uapi/asm/hwcap.h> -#if !defined(__ASSEMBLY__) +#if !defined(__ASSEMBLER__)/* * This yields a mask that user programs can use to figure out what * instruction set this cpu supports.
arch/arm/include/asm/irq.h +1 -1
@@ -22,7 +22,7 @@#define NO_IRQ ((unsigned int)(-1))#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__struct irqaction ;struct pt_regs ;
arch/arm/include/asm/kexec.h +2 -2
@@ -16,7 +16,7 @@#define KEXEC_ARM_ATAGS_OFFSET 0x1000#define KEXEC_ARM_ZIMAGE_OFFSET 0x8000 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define ARCH_HAS_KIMAGE_ARCH struct kimage_arch {
@@ -78,6 +78,6 @@ static inline struct page *boot_pfn_to_page(unsigned long boot_pfn) }#define boot_pfn_to_page boot_pfn_to_page -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ARM_KEXEC_H */
arch/arm/include/asm/kgdb.h +2 -2
@@ -39,7 +39,7 @@#define KGDB_COMPILED_BREAK 0xe7ffdeff#define CACHE_FLUSH_IS_SAFE 1 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__static inline void arch_kgdb_breakpoint (void ) {
@@ -49,7 +49,7 @@ static inline void arch_kgdb_breakpoint(void)extern void kgdb_handle_bus_error (void );extern int kgdb_fault_expected; -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ /* * From Kevin Hilman:
arch/arm/include/asm/linkage.h +2 -2
@@ -9,7 +9,7 @@ .type name, %function; \ END(name) -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__/* * Variants of SYM_TYPED_START/SYM_TYPED_FUNC_START that align the
@@ -36,6 +36,6 @@#define SYM_TYPED_FUNC_START_ALIGNED (name, align) \ SYM_TYPED_START_ALIGNED(name, SYM_L_GLOBAL, align) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
arch/arm/include/asm/mach/arch.h +1 -1
@@ -7,7 +7,7 @@#include <linux/types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/reboot.h> struct tag ;
arch/arm/include/asm/mcpm.h +2 -2
@@ -24,7 +24,7 @@#define MAX_NR_CLUSTERS 2#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/types.h> #include <asm/cacheflush.h>
@@ -307,7 +307,7 @@ struct sync_struct {#include <asm/asm-offsets.h> #define __CACHE_WRITEBACK_GRANULE CACHE_WRITEBACK_GRANULE -#endif /* ! __ASSEMBLY__ */ +#endif /* ! __ASSEMBLER__ */ /* Definitions for mcpm_sync_struct */ #define CPU_DOWN 0x11
arch/arm/include/asm/memory.h +2 -2
@@ -98,7 +98,7 @@#else /* CONFIG_MMU */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern unsigned long setup_vectors_base (void );extern unsigned long vectors_base;#define VECTORS_BASE vectors_base
@@ -155,7 +155,7 @@ extern unsigned long vectors_base;*/ #define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Physical start and end address of the kernel sections. These addresses are
arch/arm/include/asm/mpu.h +2 -2
@@ -91,7 +91,7 @@#define PMSAv7_DATA_SIDE 0#define PMSAv7_INSTR_SIDE 1 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct mpu_rgn {/* Assume same attributes for d/i-side */
@@ -128,6 +128,6 @@ static inline void pmsav7_setup(void) {};static inline void pmsav8_setup (void ) {};#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
arch/arm/include/asm/opcodes.h +6 -6
@@ -6,7 +6,7 @@#ifndef __ASM_ARM_OPCODES_H#define __ASM_ARM_OPCODES_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/linkage.h> extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);#endif
@@ -71,7 +71,7 @@ extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);* involving inline assembler. For .S files, the normal __opcode_*() macros * should do the right thing. */ -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#define ___opcode_swab32 (x) ___asm_opcode_swab32(x)#define ___opcode_swab16 (x) ___asm_opcode_swab16(x)
@@ -80,7 +80,7 @@ extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);#define ___opcode_identity32 (x) ___asm_opcode_identity32(x)#define ___opcode_identity16 (x) ___asm_opcode_identity16(x) -#else /* ! __ASSEMBLY__ */ +#else /* ! __ASSEMBLER__ */ #include <linux/types.h> #include <linux/swab.h>
@@ -92,7 +92,7 @@ extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);#define ___opcode_identity32 (x) ((u32)(x))#define ___opcode_identity16 (x) ((u16)(x)) -#endif /* ! __ASSEMBLY__ */ +#endif /* ! __ASSEMBLER__ */ #ifdef CONFIG_CPU_ENDIAN_BE8
@@ -111,7 +111,7 @@ extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr);#define ___asm_opcode_to_mem_arm (x) ___asm_opcode_identity32(x)#define ___asm_opcode_to_mem_thumb16 (x) ___asm_opcode_identity16(x)#ifdef CONFIG_CPU_ENDIAN_BE32 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * On BE32 systems, using 32-bit accesses to store Thumb instructions will not * work in all cases, due to alignment constraints. For now, a correct
@@ -219,7 +219,7 @@ extern __u32 __opcode_to_mem_thumb32(__u32);#endif /* Helpers for the helpers. Don't use these directly. */ -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#define ___inst_arm (x) .long x#define ___inst_thumb16 (x) .short x#define ___inst_thumb32 (first, second) .short first, second
arch/arm/include/asm/page.h +2 -2
@@ -9,7 +9,7 @@#include <vdso/page.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifndef CONFIG_MMU
@@ -180,7 +180,7 @@ extern int pfn_valid(unsigned long);#define pfn_valid pfn_valid#endif -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #include <asm/memory.h>
arch/arm/include/asm/pgtable-2level.h +2 -2
@@ -168,7 +168,7 @@#define L_PTE_MT_VECTORS (_AT(pteval_t, 0x0f) << 2)/* 1111 */ #define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * The "pud_xxx()" functions here are trivial when the pmd is folded into
@@ -235,6 +235,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)*/ #define pmd_hugewillfault (pmd) (0) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_PGTABLE_2LEVEL_H */
arch/arm/include/asm/pgtable-3level.h +2 -2
@@ -109,7 +109,7 @@*/ #define L_PGD_SWAPPER (_AT(pgdval_t, 1) << 55)/* swapper_pg_dir entry */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define pud_none (pud) (!pud_val(pud))#define pud_bad (pud) (!(pud_val(pud) & PUD_TABLE_BIT))
@@ -245,6 +245,6 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,flush_pmd_entry (pmdp); } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_PGTABLE_3LEVEL_H */
arch/arm/include/asm/pgtable-nommu.h +2 -2
@@ -8,7 +8,7 @@#ifndef _ASMARM_PGTABLE_NOMMU_H#define _ASMARM_PGTABLE_NOMMU_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/slab.h> #include <asm/processor.h>
@@ -84,6 +84,6 @@ extern unsigned int kobjsize(const void *objp);#define v6_user_fns (0)#define xscale_mc_user_fns (0) -#endif /*__ASSEMBLY__*/ +#endif /*__ASSEMBLER__*/ #endif /* _ASMARM_PGTABLE_H */
arch/arm/include/asm/pgtable.h +4 -4
@@ -43,7 +43,7 @@#define LIBRARY_TEXT_START 0x0c000000 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern void __pte_error (const char *file,int line,pte_t );extern void __pmd_error (const char *file,int line,pmd_t );extern void __pgd_error (const char *file,int line,pgd_t );
@@ -126,7 +126,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED | L_PTE_XN)#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * The table below defines the page protection levels that we insert into our
@@ -137,7 +137,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,* 3) write implies read permissions */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern pgd_t swapper_pg_dir[PTRS_PER_PGD ];
@@ -320,7 +320,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)#define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* CONFIG_MMU */
arch/arm/include/asm/probes.h +2 -2
@@ -11,7 +11,7 @@#ifndef _ASM_PROBES_H#define _ASM_PROBES_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__typedef u32 probes_opcode_t ;
@@ -37,7 +37,7 @@ struct arch_probes_insn { bool kprobe_direct_exec; }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * We assume one instruction can consume at most 64 bytes stack, which is
arch/arm/include/asm/proc-fns.h +2 -2
@@ -13,7 +13,7 @@#include <asm/glue-proc.h> #include <asm/page.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__struct mm_struct ;
@@ -196,6 +196,6 @@ static inline void cpu_set_ttbcr(unsigned int ttbcr)#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __KERNEL__ */ #endif /* __ASM_PROCFNS_H */
arch/arm/include/asm/ptrace.h +2 -2
@@ -9,7 +9,7 @@#include <uapi/asm/ptrace.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/bitfield.h> #include <linux/types.h>
@@ -198,5 +198,5 @@ static inline unsigned long it_advance(unsigned long cpsr)int syscall_trace_enter (struct pt_regs *regs);void syscall_trace_exit (struct pt_regs *regs); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
arch/arm/include/asm/system_info.h +2 -2
@@ -14,7 +14,7 @@#define CPU_ARCH_ARMv7 9#define CPU_ARCH_ARMv7M 10 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* information about the system we're running on */ extern unsigned int system_rev;
@@ -25,6 +25,6 @@ extern unsigned int mem_fclk_21285;extern int __pure cpu_architecture (void ); -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __ASM_ARM_SYSTEM_INFO_H */
arch/arm/include/asm/system_misc.h +2 -2
@@ -2,7 +2,7 @@#ifndef __ASM_ARM_SYSTEM_MISC_H#define __ASM_ARM_SYSTEM_MISC_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/compiler.h> #include <linux/linkage.h>
@@ -37,6 +37,6 @@ static inline void harden_branch_predictor(void)extern unsigned int user_debug; -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __ASM_ARM_SYSTEM_MISC_H */
arch/arm/include/asm/thread_info.h +1 -1
@@ -33,7 +33,7 @@#define OVERFLOW_STACK_SIZE SZ_4K -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__struct task_struct ;
arch/arm/include/asm/thread_notify.h +1 -1
@@ -9,7 +9,7 @@#ifdef __KERNEL__ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/notifier.h> #include <asm/thread_info.h>
arch/arm/include/asm/tlbflush.h +5 -5
@@ -7,7 +7,7 @@#ifndef _ASMARM_TLBFLUSH_H#define _ASMARM_TLBFLUSH_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__# include <linux/mm_types.h> #endif
@@ -200,7 +200,7 @@#error Unknown TLB model#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/sched.h>
@@ -641,7 +641,7 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf,#elif defined(CONFIG_SMP )/* !CONFIG_MMU */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__static inline void local_flush_tlb_all (void ) { }static inline void local_flush_tlb_mm (struct mm_struct *mm) { }static inline void local_flush_tlb_page (struct vm_area_struct *vma,unsigned long uaddr) { }
@@ -657,11 +657,11 @@ extern void flush_tlb_kernel_page(unsigned long kaddr);extern void flush_tlb_range (struct vm_area_struct *vma,unsigned long start,unsigned long end);extern void flush_tlb_kernel_range (unsigned long start,unsigned long end);extern void flush_bp_all (void ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifdef CONFIG_ARM_ERRATA_798181 extern void erratum_a15_798181_init (void );#else
arch/arm/include/asm/tls.h +2 -2
@@ -5,7 +5,7 @@#include <linux/compiler.h> #include <asm/thread_info.h> -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#include <asm/asm-offsets.h> .macro switch_tls_none, base, tp, tpuser, tmp1, tmp2 .endm
@@ -68,7 +68,7 @@ ALT_UP_B(.L0_\@)#define switch_tls switch_tls_software#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__static inline void set_tls (unsigned long val) {
arch/arm/include/asm/unified.h +3 -3
@@ -8,7 +8,7 @@#ifndef __ASM_UNIFIED_H#define __ASM_UNIFIED_H -#if defined(__ASSEMBLY__) +#if defined(__ASSEMBLER__) .syntax unified#else __asm__(".syntax unified" );
@@ -29,7 +29,7 @@ __asm__(".syntax unified"); #define ARM(x...) #define THUMB(x...) x -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#define W (instr) instr.w#else #define WASM (instr) #instr ".w"
@@ -42,7 +42,7 @@ __asm__(".syntax unified"); #define ARM(x...) x #define THUMB(x...) -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#define W (instr) instr#else #define WASM (instr) #instr
arch/arm/include/asm/unwind.h +2 -2
@@ -8,7 +8,7 @@#ifndef __ASM_UNWIND_H#define __ASM_UNWIND_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* Unwind reason code according the the ARM EABI documents */ enum unwind_reason_code {
@@ -44,7 +44,7 @@ void __aeabi_unwind_cpp_pr0(void);void __aeabi_unwind_cpp_pr1 (void );void __aeabi_unwind_cpp_pr2 (void ); -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #ifdef CONFIG_ARM_UNWIND #define UNWIND(code...) code
arch/arm/include/asm/v7m.h +2 -2
@@ -89,10 +89,10 @@#define V7M_SCB_DCCISW 0x274/* D-cache clean and invalidate by set-way */ #define V7M_SCB_BPIALL 0x278/* D-cache clean and invalidate by set-way */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__enum reboot_mode ;void armv7m_restart (enum reboot_mode mode,const char *cmd); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */
arch/arm/include/asm/vdso.h +2 -2
@@ -6,7 +6,7 @@#define __VDSO_PAGES 4 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__struct mm_struct ;
@@ -26,7 +26,7 @@ static inline void arm_install_vdso(struct mm_struct *mm, unsigned long addr)#endif /* CONFIG_VDSO */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __KERNEL__ */
arch/arm/include/asm/vdso/cp15.h +2 -2
@@ -5,7 +5,7 @@#ifndef __ASM_VDSO_CP15_H#define __ASM_VDSO_CP15_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifdef CONFIG_CPU_CP15
@@ -33,6 +33,6 @@#endif /* CONFIG_CPU_CP15 */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_VDSO_CP15_H */
arch/arm/include/asm/vdso/gettimeofday.h +2 -2
@@ -5,7 +5,7 @@#ifndef __ASM_VDSO_GETTIMEOFDAY_H#define __ASM_VDSO_GETTIMEOFDAY_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/barrier.h> #include <asm/errno.h>
@@ -137,6 +137,6 @@ static __always_inline u64 __arch_get_hw_counter(int clock_mode,#endif } -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __ASM_VDSO_GETTIMEOFDAY_H */
arch/arm/include/asm/vdso/processor.h +2 -2
@@ -5,7 +5,7 @@#ifndef __ASM_VDSO_PROCESSOR_H#define __ASM_VDSO_PROCESSOR_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#if __LINUX_ARM_ARCH__ ==6 || defined(CONFIG_ARM_ERRATA_754327 )#define cpu_relax () \
@@ -17,6 +17,6 @@#define cpu_relax () barrier()#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_VDSO_PROCESSOR_H */
arch/arm/include/asm/vfp.h +1 -1
@@ -90,7 +90,7 @@#define VFPOPDESC_UNUSED_MASK (0xFF << VFPOPDESC_UNUSED_BIT)#define VFPOPDESC_OPDESC_MASK (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK)) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__void vfp_disable (void );#endif
arch/arm/include/asm/virt.h +2 -2
@@ -15,7 +15,7 @@*/ #define BOOT_CPU_MODE_MISMATCH PSR_N_BIT -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/cacheflush.h> #ifdef CONFIG_ARM_VIRT_EXT
@@ -74,7 +74,7 @@ static inline bool is_kernel_in_hyp_mode(void)#define HVC_SET_VECTORS 0#define HVC_SOFT_RESTART 1 -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #define HVC_STUB_ERR 0xbadca11
arch/arm/mach-footbridge/include/mach/hardware.h +1 -1
@@ -79,7 +79,7 @@#define CPLD_UNMUTE 2#define CPLD_FLASH_WR_ENABLE 1 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern raw_spinlock_t nw_gpio_lock;extern void nw_gpio_modify_op (unsigned int mask,unsigned int set);extern void nw_gpio_modify_io (unsigned int mask,unsigned int in);
arch/arm/mach-sa1100/include/mach/bitfield.h +1 -1
@@ -15,7 +15,7 @@#ifndef __BITFIELD_H#define __BITFIELD_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define UData (Data) ((unsigned long) (Data))#else #define UData (Data) (Data)
arch/arm/mach-sa1100/include/mach/hardware.h +1 -1
@@ -39,7 +39,7 @@#define __MREG (x) IOMEM(io_p2v(x)) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__# define __REG (x) (*((volatile unsigned long __iomem *)io_p2v(x)))# define __PREG (x) (io_v2p((unsigned long)&(x)))
arch/arm/tools/gen-mach-types +1 -1
@@ -29,7 +29,7 @@ END { printf(" */\n\n"); printf("#ifndef __ASM_ARM_MACH_TYPE_H\n"); printf("#define __ASM_ARM_MACH_TYPE_H\n\n"); - printf("#ifndef __ASSEMBLY__\n"); + printf("#ifndef __ASSEMBLER__\n"); printf("/* The type of machine we're running on */\n"); printf("extern unsigned int __machine_arch_type;\n"); printf("#endif\n\n");
Signature · 1 line
2.56.0
PATCH v5 10/13 uapi: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
In reply to Thomas Huth__ASSEMBLY__ is only defined by the Makefile of the kernel, so this is not really useful for uapi headers (unless the userspace Makefile defines it, too). Let's switch to __ASSEMBLER__ which gets set automatically by the compiler when compiling assembly code.
--- Documentation/dev-tools/checkuapi.rst | 2 +- include/uapi/linux/a.out.h | 4 ++-- include/uapi/linux/const.h | 4 ++-- include/uapi/linux/edd.h | 4 ++-- include/uapi/linux/hdlc/ioctl.h | 4 ++-- include/uapi/linux/types.h | 4 ++-- tools/include/uapi/linux/const.h | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-)
Documentation/dev-tools/checkuapi.rst +1 -1
@@ -273,7 +273,7 @@ Consider this change:: -typedef unsigned __bitwise __poll_t; +typedef unsigned short __bitwise __poll_t; - #endif /* __ASSEMBLY__ */ + #endif /* __ASSEMBLER__ */ #endif /* _UAPI_LINUX_TYPES_H */ EOF
include/uapi/linux/a.out.h +2 -2
@@ -10,7 +10,7 @@#endif /* __STRUCT_EXEC_OVERRIDE__ */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* these go in the N_MACHTYPE field */ enum machine_type {
@@ -247,5 +247,5 @@ struct relocation_info };#endif /* no N_RELOCATION_INFO_DECLARED. */ -#endif /*__ASSEMBLY__ */ +#endif /*__ASSEMBLER__ */ #endif /* _UAPI__A_OUT_GNU_H__ */
include/uapi/linux/const.h +2 -2
@@ -13,7 +13,7 @@* leave it unchanged in asm. */ -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#define _AC (X ,Y ) X#define _AT (T ,X ) X#else
@@ -28,7 +28,7 @@#define _BITUL (x) (_UL(1) << (x))#define _BITULL (x) (_ULL(1) << (x)) -#if !defined(__ASSEMBLY__) +#if !defined(__ASSEMBLER__)/* * Missing asm support *
include/uapi/linux/edd.h +2 -2
@@ -53,7 +53,7 @@#define EDD_MBR_SIG_NR_BUF 0x1ea/* addr of number of MBR signtaures at EDD_MBR_SIG_BUF in boot_params - treat this as 1 byte */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define EDD_EXT_FIXED_DISK_ACCESS (1 << 0)#define EDD_EXT_DEVICE_LOCKING_AND_EJECTING (1 << 1)
@@ -187,6 +187,6 @@ struct edd {unsigned char edd_info_nr; }; -#endif /*!__ASSEMBLY__ */ +#endif /*!__ASSEMBLER__ */ #endif /* _UAPI_LINUX_EDD_H */
include/uapi/linux/hdlc/ioctl.h +2 -2
@@ -35,7 +35,7 @@#define LMI_CCITT 3/* ITU-T Annex A */ #define LMI_CISCO 4/* The "original" LMI, aka Gang of Four */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ typedef struct { unsigned int clock_rate; /* bits per second */
@@ -90,5 +90,5 @@ typedef struct {/* PPP doesn't need any info now - supply length = 0 to ioctl */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __HDLC_IOCTL_H__ */
include/uapi/linux/types.h +2 -2
@@ -4,7 +4,7 @@#include <asm/types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifndef __KERNEL__#ifndef __EXPORTED_HEADERS__#warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders"
@@ -59,5 +59,5 @@ typedef __u32 __bitwise __wsum;typedef unsigned __bitwise __poll_t ; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI_LINUX_TYPES_H */
tools/include/uapi/linux/const.h +2 -2
@@ -13,7 +13,7 @@* leave it unchanged in asm. */ -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#define _AC (X ,Y ) X#define _AT (T ,X ) X#else
@@ -28,7 +28,7 @@#define _BITUL (x) (_UL(1) << (x))#define _BITULL (x) (_ULL(1) << (x)) -#if !defined(__ASSEMBLY__) +#if !defined(__ASSEMBLER__)/* * Missing asm support *
Signature · 1 line
2.56.0
PATCH v5 11/13 asm-generic: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
In reply to Thomas HuthWhile the GCC and Clang compilers already define __ASSEMBLER__ auto- matically 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. Let's standardize now on the __ASSEMBLER__ macro to avoid this confusion.
--- include/asm-generic/barrier.h | 4 ++-- include/asm-generic/bug.h | 4 ++-- include/asm-generic/current.h | 2 +- include/asm-generic/error-injection.h | 2 +- include/asm-generic/int-ll64.h | 6 +++--- include/asm-generic/rwonce.h | 4 ++-- include/asm-generic/signal.h | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-)
include/asm-generic/barrier.h +2 -2
@@ -11,7 +11,7 @@#ifndef __ASM_GENERIC_BARRIER_H#define __ASM_GENERIC_BARRIER_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/compiler.h> #include <linux/kcsan-checks.h>
@@ -302,5 +302,5 @@ do { \# define smp_mb__after_switch_mm () smp_mb()#endif -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __ASM_GENERIC_BARRIER_H */
include/asm-generic/bug.h +2 -2
@@ -26,7 +26,7 @@#endif #endif /* WARN_CONDITION_STR */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/panic.h> #include <linux/printk.h>
@@ -258,6 +258,6 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);# define WARN_ON_SMP (x) ({0;})#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
include/asm-generic/current.h +1 -1
@@ -2,7 +2,7 @@#ifndef __ASM_GENERIC_CURRENT_H#define __ASM_GENERIC_CURRENT_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/thread_info.h> #define get_current () (current_thread_info()->task)
include/asm-generic/error-injection.h +1 -1
@@ -2,7 +2,7 @@#ifndef _ASM_GENERIC_ERROR_INJECTION_H#define _ASM_GENERIC_ERROR_INJECTION_H -#if defined(__KERNEL__) && !defined(__ASSEMBLY__) +#if defined(__KERNEL__) && !defined(__ASSEMBLER__)enum {EI_ETYPE_NULL ,/* Return NULL if failure */ EI_ETYPE_ERRNO, /* Return -ERRNO if failure */
include/asm-generic/int-ll64.h +3 -3
@@ -11,7 +11,7 @@#include <uapi/asm-generic/int-ll64.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__typedef __s8 s8 ;typedef __u8 u8 ;
@@ -31,7 +31,7 @@ typedef __u64 u64;#define S64_C (x) x ## LL#define U64_C (x) x ## ULL -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ #define S8_C (x) x#define U8_C (x) x
@@ -42,6 +42,6 @@ typedef __u64 u64;#define S64_C (x) x#define U64_C (x) x -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_GENERIC_INT_LL64_H */
include/asm-generic/rwonce.h +2 -2
@@ -20,7 +20,7 @@#ifndef __ASM_GENERIC_RWONCE_H#define __ASM_GENERIC_RWONCE_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/compiler_types.h> #include <linux/kasan-checks.h>
@@ -94,5 +94,5 @@ unsigned long read_word_at_a_time(const void *addr)return *(unsigned long *)addr; } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_GENERIC_RWONCE_H */
include/asm-generic/signal.h +2 -2
@@ -4,10 +4,10 @@#include <uapi/asm-generic/signal.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/sigcontext.h> #undef __HAVE_ARCH_SIG_BITOPS -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_GENERIC_SIGNAL_H */
Signature · 1 line
2.56.0
PATCH v5 12/13 include: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
In reply to Thomas HuthWhile 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 completely mechanical patch (done with a simple "sed -i" statement).
--- include/linux/amba/serial.h | 4 ++-- include/linux/annotate.h | 18 +++++++++--------- include/linux/cfi_types.h | 6 +++--- include/linux/compiler.h | 4 ++-- include/linux/compiler_types.h | 8 ++++---- include/linux/edd.h | 4 ++-- include/linux/err.h | 2 +- include/linux/export.h | 2 +- include/linux/init.h | 6 +++--- include/linux/ioport.h | 4 ++-- include/linux/linkage.h | 6 +++--- include/linux/mem_encrypt.h | 4 ++-- include/linux/pe.h | 4 ++-- include/linux/platform_data/emif_plat.h | 4 ++-- include/linux/ti-emif-sram.h | 2 +- include/linux/types.h | 4 ++-- tools/include/asm-generic/barrier.h | 4 ++-- tools/include/asm/alternative.h | 2 +- tools/include/linux/cfi_types.h | 6 +++--- tools/include/linux/compiler.h | 4 ++-- 20 files changed, 49 insertions(+), 49 deletions(-)
include/linux/amba/serial.h +2 -2
@@ -10,7 +10,7 @@#ifndef ASM_ARM_HARDWARE_SERIAL_AMBA_H #define ASM_ARM_HARDWARE_SERIAL_AMBA_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/bitfield.h> #include <linux/bits.h> #endif
@@ -215,7 +215,7 @@#define UART01x_RSR_ANY (UART01x_RSR_OE | UART01x_RSR_BE | UART01x_RSR_PE | UART01x_RSR_FE)#define UART01x_FR_MODEM_ANY (UART01x_FR_DCD | UART01x_FR_DSR | UART01x_FR_CTS) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct amba_device; /* in uncompress this is included but amba/bus.h is not */ struct amba_pl010_data { void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl);
include/linux/annotate.h +9 -9
@@ -11,7 +11,7 @@ .long label - ., type; \ .popsection -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define ASM_ANNOTATE_LABEL (label, type) \ __stringify(__ASM_ANNOTATE(.discard.annotate_insn, label, type))
@@ -24,7 +24,7 @@"912: " \ __stringify(__ASM_ANNOTATE(.discard.annotate_data, 912b, type)) -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ .macro ANNOTATE type .Lhere_\@:
@@ -36,22 +36,22 @@ __ASM_ANNOTATE(.discard.annotate_data, .Lhere_\@, \type) .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #else /* !CONFIG_OBJTOOL */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define ASM_ANNOTATE_LABEL (label, type) ""#define ASM_ANNOTATE (type)#define ASM_ANNOTATE_DATA (type) -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ .macro ANNOTATE type .endm .macro ANNOTATE_DATA type .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* !CONFIG_OBJTOOL */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Annotate away the various 'relocation to !ENDBR` complaints; knowing that
@@ -111,7 +111,7 @@*/ #define ANNOTATE_DATA_SPECIAL ASM_ANNOTATE_DATA(ANNOTYPE_DATA_SPECIAL) -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ #define ANNOTATE_NOENDBR ANNOTATE type=ANNOTYPE_NOENDBR#define ANNOTATE_RETPOLINE_SAFE ANNOTATE type=ANNOTYPE_RETPOLINE_SAFE/* ANNOTATE_INSTR_BEGIN ANNOTATE type=ANNOTYPE_INSTR_BEGIN */
@@ -122,6 +122,6 @@#define ANNOTATE_REACHABLE ANNOTATE type=ANNOTYPE_REACHABLE#define ANNOTATE_NOCFI_SYM ANNOTATE type=ANNOTYPE_NOCFI#define ANNOTATE_DATA_SPECIAL ANNOTATE_DATA type=ANNOTYPE_DATA_SPECIAL -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_ANNOTATE_H */
include/linux/cfi_types.h +3 -3
@@ -5,7 +5,7 @@#ifndef _LINUX_CFI_TYPES_H#define _LINUX_CFI_TYPES_H -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#include <linux/linkage.h> #ifdef CONFIG_CFI
@@ -41,7 +41,7 @@ SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)#endif -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ #ifdef CONFIG_CFI #define DEFINE_CFI_TYPE (name, func) \
@@ -64,5 +64,5 @@ );#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_CFI_TYPES_H */
include/linux/compiler.h +2 -2
@@ -4,7 +4,7 @@#include <linux/compiler_types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifdef __KERNEL__
@@ -277,7 +277,7 @@ static inline void *offset_to_ptr(const int *off) return (void *)((unsigned long)off + *off); } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * Force the compiler to emit 'sym' as a symbol, so that we can reference
include/linux/compiler_types.h +4 -4
@@ -15,7 +15,7 @@#define ___PASTE (a, b) a##b#define __PASTE (a, b) ___PASTE(a, b) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * C23 introduces "auto" as a standard way to define type-inferred
@@ -454,7 +454,7 @@ struct ftrace_likely_data {#endif /* __KERNEL__ */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * The below symbols may be defined for one or more, but not ALL, of the above
@@ -598,7 +598,7 @@ struct ftrace_likely_data {#define asm_inline asm#endif -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Use __typeof_unqual__() when available. */
@@ -637,7 +637,7 @@ struct ftrace_likely_data {#include <asm/percpu_types.h> -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ /* * __signed_scalar_typeof(x) - Declare a signed scalar type, leaving
include/linux/edd.h +2 -2
@@ -23,7 +23,7 @@#include <uapi/linux/edd.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__extern struct edd edd; -#endif /*!__ASSEMBLY__ */ +#endif /*!__ASSEMBLER__ */ #endif /* _LINUX_EDD_H */
include/linux/err.h +1 -1
@@ -17,7 +17,7 @@*/ #define MAX_ERRNO 4095 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/** * IS_ERR_VALUE - Detect an error pointer.
include/linux/export.h +1 -1
@@ -51,7 +51,7 @@#define __EXPORT_SYMBOL (sym, license, ns) __GENKSYMS_EXPORT_SYMBOL(sym) -#elif defined(__ASSEMBLY__) +#elif defined(__ASSEMBLER__)#define __EXPORT_SYMBOL (sym, license, ns) \ ___EXPORT_SYMBOL(sym, license, ns)
include/linux/init.h +3 -3
@@ -102,7 +102,7 @@#define __REFDATA .section ".ref.data", "aw"#define __REFCONST .section ".ref.rodata", "a" -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * Used for initialization calls.. */
@@ -180,7 +180,7 @@ extern struct module __this_module;#ifndef MODULE -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * initcalls are now grouped by functionality into separate
@@ -375,7 +375,7 @@ extern const struct obs_kernel_param __setup_start[], __setup_end[];/* Relies on boot_command_line being set */ void __init parse_early_param (void );void __init parse_early_options (char *cmdline); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #else /* MODULE */
include/linux/ioport.h +2 -2
@@ -9,7 +9,7 @@#ifndef _LINUX_IOPORT_H#define _LINUX_IOPORT_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/args.h> #include <linux/bits.h> #include <linux/compiler.h>
@@ -461,5 +461,5 @@ static inline void irqresource_disabled(struct resource *res, u32 irq)extern struct address_space *iomem_get_mapping (void ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_IOPORT_H */
include/linux/linkage.h +3 -3
@@ -66,7 +66,7 @@* end up needing stack temporaries for). */ /* Assembly files may be compiled with -traditional .. */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifndef asmlinkage_protect # define asmlinkage_protect(n, ret, args...) do { } while (0)#endif
@@ -77,7 +77,7 @@#define __ALIGN_STR __stringify(__ALIGN)#endif -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__/* SYM_T_FUNC -- type used by assembler to mark functions */ #ifndef SYM_T_FUNC
@@ -355,6 +355,6 @@ SYM_DATA_END(name)#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_LINKAGE_H */
include/linux/mem_encrypt.h +2 -2
@@ -10,7 +10,7 @@#ifndef __MEM_ENCRYPT_H__#define __MEM_ENCRYPT_H__ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#ifdef CONFIG_ARCH_HAS_MEM_ENCRYPT
@@ -54,6 +54,6 @@#define dma_addr_canonical (x) (x)#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __MEM_ENCRYPT_H__ */
include/linux/pe.h +2 -2
@@ -240,7 +240,7 @@#define IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS 20/* Extended DLL characteristics bits */ #define IMAGE_DEBUG_TYPE_PERFMAP 21/* Location of associated Ready To Run PerfMap file */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct mz_hdr { uint16_t magic; /* MZ_MAGIC */
@@ -546,6 +546,6 @@ struct win_certificate {uint16_t cert_type; }; -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __LINUX_PE_H */
include/linux/platform_data/emif_plat.h +2 -2
@@ -39,7 +39,7 @@#define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002#define EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART 0x00000004 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/** * struct ddr_device_info - All information about the DDR device except AC * timing parameters
@@ -121,6 +121,6 @@ struct emif_platform_data {u32 ip_rev;u32 phy_type; }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __LINUX_EMIF_H */
include/linux/ti-emif-sram.h +1 -1
@@ -10,7 +10,7 @@#include <linux/kbuild.h> #include <linux/types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct emif_regs_amx3 { u32 emif_sdcfg_val;
include/linux/types.h +2 -2
@@ -4,7 +4,7 @@#include <uapi/linux/types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#define DECLARE_BITMAP (name,bits) \ unsigned long name[BITS_TO_LONGS(bits)]
@@ -288,5 +288,5 @@ struct rcuwait {struct task_struct __rcu *task; }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_TYPES_H */
tools/include/asm-generic/barrier.h +2 -2
@@ -13,7 +13,7 @@#ifndef __TOOLS_LINUX_ASM_GENERIC_BARRIER_H#define __TOOLS_LINUX_ASM_GENERIC_BARRIER_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/compiler.h>
@@ -36,5 +36,5 @@#define wmb () mb()#endif -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __TOOLS_LINUX_ASM_GENERIC_BARRIER_H */
tools/include/asm/alternative.h +1 -1
@@ -3,7 +3,7 @@#define _TOOLS_ASM_ALTERNATIVE_ASM_H#if defined(__s390x__) -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__ .macro ALTERNATIVE oldinstr, newinstr, feature \oldinstr .endm
tools/include/linux/cfi_types.h +3 -3
@@ -5,7 +5,7 @@#ifndef _LINUX_CFI_TYPES_H#define _LINUX_CFI_TYPES_H -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#include <linux/linkage.h> #ifdef CONFIG_CFI
@@ -41,7 +41,7 @@ SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)#endif -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ #ifdef CONFIG_CFI #define DEFINE_CFI_TYPE (name, func) \
@@ -64,5 +64,5 @@ );#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_CFI_TYPES_H */
tools/include/linux/compiler.h +2 -2
@@ -2,7 +2,7 @@#ifndef _TOOLS_LINUX_COMPILER_H_#define _TOOLS_LINUX_COMPILER_H_ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/compiler_types.h>
@@ -256,6 +256,6 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s#endif #endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _TOOLS_LINUX_COMPILER_H */
Signature · 1 line
2.56.0
PATCH v5 13/13 treewide: Stop defining __ASSEMBLY__ for assembler files
In reply to Thomas HuthAll spots have been changed to __ASSEMBLER__ (i.e. the macro that gets defined by the compiler), so we don't have to manually define __ASSEMBLY__ anymore.
--- Makefile | 2 +- arch/alpha/boot/compressed/Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 1 - arch/loongarch/vdso/Makefile | 2 +- arch/mips/boot/compressed/Makefile | 2 +- arch/mips/vdso/Makefile | 2 +- arch/powerpc/boot/Makefile | 2 +- arch/powerpc/platforms/cell/spufs/Makefile | 2 +- arch/s390/Makefile | 2 +- arch/x86/boot/Makefile | 2 +- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/realmode/rm/Makefile | 2 +- arch/xtensa/kernel/Makefile | 2 +- drivers/firmware/efi/libstub/Makefile | 2 +- drivers/net/wan/Makefile | 2 +- scripts/Makefile.build | 2 +- scripts/gfp-translate | 2 +- scripts/headers_install.sh | 1 - scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py | 2 +- tools/testing/selftests/kvm/lib/riscv/handlers.S | 4 ---- tools/testing/selftests/vDSO/vgetrandom-chacha.S | 2 -- 21 files changed, 17 insertions(+), 25 deletions(-)
Makefile +1 -1
@@ -606,7 +606,7 @@ LINUXINCLUDE := \ -I$(objtree)/include \ $(USERINCLUDE) -KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE +KBUILD_AFLAGS := -fno-PIE KBUILD_CFLAGS := KBUILD_CFLAGS += -fshort-wchar
arch/alpha/boot/compressed/Makefile +1 -1
@@ -22,7 +22,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -pipe -mcpu=ev4 -mno-fp-regs -ffixed-8 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING -D__DISABLE_EXPORTS KBUILD_CFLAGS += $(CC_FLAGS_DIALECT) -KBUILD_AFLAGS := -D__ASSEMBLY__ $(KBUILD_CFLAGS) +KBUILD_AFLAGS := $(KBUILD_CFLAGS) # The stub has no sanitizer or coverage runtime. arch/alpha/lib/lib.a is # built with the kernel's instrumentation and -mcpu=, so build private
arch/arm64/kernel/vdso32/Makefile +0 -1
@@ -77,7 +77,6 @@ VDSO_CFLAGS += -marm endif VDSO_AFLAGS := $(VDSO_CAFLAGS) -VDSO_AFLAGS += -D__ASSEMBLY__ # From arm vDSO Makefile VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
arch/loongarch/vdso/Makefile +1 -1
@@ -32,7 +32,7 @@ cflags-vdso := $(ccflags-vdso) \ $(call cc-option, -fasynchronous-unwind-tables) \ $(call cc-option, -fno-stack-protector) aflags-vdso := $(ccflags-vdso) \ - -D__ASSEMBLY__ -Wa,-gdwarf-2 + -Wa,-gdwarf-2 ifneq ($(c-gettimeofday-y),) CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
arch/mips/boot/compressed/Makefile +1 -1
@@ -30,7 +30,7 @@ endif KBUILD_CFLAGS := $(KBUILD_CFLAGS) -D__KERNEL__ -D__DISABLE_EXPORTS \ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" -KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ +KBUILD_AFLAGS := $(KBUILD_AFLAGS) \ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \ -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
arch/mips/vdso/Makefile +1 -1
@@ -33,7 +33,7 @@ cflags-vdso := $(ccflags-vdso) \ -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \ $(call cc-option, -fno-asynchronous-unwind-tables) aflags-vdso := $(ccflags-vdso) \ - -D__ASSEMBLY__ -Wa,-gdwarf-2 + -Wa,-gdwarf-2 ifneq ($(c-gettimeofday-y),) obj-vdso-y += vgettimeofday.o
arch/powerpc/boot/Makefile +1 -1
@@ -80,7 +80,7 @@ BOOTCFLAGS := $(BOOTTARGETFLAGS) \ $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ -fomit-frame-pointer -fno-builtin -fPIC -BOOTAFLAGS := $(BOOTTARGETFLAGS) -D__ASSEMBLY__ +BOOTAFLAGS := $(BOOTTARGETFLAGS) BOOTARFLAGS := -crD
arch/powerpc/platforms/cell/spufs/Makefile +1 -1
@@ -15,7 +15,7 @@ SPU_AS := $(SPU_CROSS)gcc SPU_LD := $(SPU_CROSS)ld SPU_OBJCOPY := $(SPU_CROSS)objcopy SPU_CFLAGS := -O2 -Wall -I$(srctree)/include -D__KERNEL__ -SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include -D__KERNEL__ +SPU_AFLAGS := -c -I$(srctree)/include -D__KERNEL__ SPU_LDFLAGS := -N -Ttext=0x0 $(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
arch/s390/Makefile +1 -1
@@ -17,7 +17,7 @@ KBUILD_CFLAGS += -fPIC LDFLAGS_vmlinux := $(call ld-option,-no-pie) extra_tools := relocs aflags_dwarf := -Wa,-gdwarf-2 -KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__ +KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 ifndef CONFIG_AS_IS_LLVM KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf)) endif
arch/x86/boot/Makefile +1 -1
@@ -52,7 +52,7 @@ targets += cpustr.h # --------------------------------------------------------------------------- KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ +KBUILD_AFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
arch/x86/boot/compressed/Makefile +1 -1
@@ -49,7 +49,7 @@ KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h # that the compiler finds it even with out-of-tree builds (make O=/some/path). CFLAGS_sev-handle-vc.o += -I$(objtree)/arch/x86/lib/ -KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ +KBUILD_AFLAGS := $(KBUILD_CFLAGS) KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) KBUILD_LDFLAGS += $(call ld-option,--no-ld-generated-unwind-info)
arch/x86/realmode/rm/Makefile +1 -1
@@ -65,5 +65,5 @@ $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \ -I$(srctree)/arch/x86/boot -KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ +KBUILD_AFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
arch/xtensa/kernel/Makefile +1 -1
@@ -39,7 +39,7 @@ sed-y = -e ':a; s/\*(\([^)]*\)\.text\.unlikely/*(\1.literal.unlikely .{text}.unl -e 's/\.{text}/.text/g' quiet_cmd__cpp_lds_S = LDS $@ -cmd__cpp_lds_S = $(CPP) $(cpp_flags) -P -C -Uxtensa -D__ASSEMBLY__ \ +cmd__cpp_lds_S = $(CPP) $(cpp_flags) -P -C -Uxtensa \ -DLINKER_SCRIPT $< | sed $(sed-y) >$@ $(obj)/vmlinux.lds: $(src)/vmlinux.lds.S FORCE
drivers/firmware/efi/libstub/Makefile +1 -1
@@ -61,7 +61,7 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS)) # `-fdata-sections` flag from KBUILD_CFLAGS_KERNEL KBUILD_CFLAGS_KERNEL := $(filter-out -fdata-sections, $(KBUILD_CFLAGS_KERNEL)) -KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ +KBUILD_AFLAGS := $(KBUILD_CFLAGS) lib-y := efi-stub-helper.o gop.o secureboot.o tpm.o \ file.o mem.o random.o randomalloc.o pci.o \
drivers/net/wan/Makefile +1 -1
@@ -57,7 +57,7 @@ $(obj)/wanxlfw.bin: $(obj)/wanxlfw.o FORCE $(call if_changed,m68kld_bin_o) quiet_cmd_m68kas_o_S = M68KAS $@ - cmd_m68kas_o_S = $(M68KCC) -D__ASSEMBLY__ -Wp,-MD,$(depfile) -I$(srctree)/include/uapi -c -o $@ $< + cmd_m68kas_o_S = $(M68KCC) -Wp,-MD,$(depfile) -I$(srctree)/include/uapi -c -o $@ $< $(obj)/wanxlfw.o: $(src)/wanxlfw.S FORCE $(call if_changed_dep,m68kas_o_S)
scripts/Makefile.build +1 -1
@@ -465,7 +465,7 @@ targets += $(lib-y) $(always-y) # --------------------------------------------------------------------------- quiet_cmd_cpp_lds_S = LDS $@ cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -U$(ARCH) \ - -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $< + -DLINKER_SCRIPT -o $@ $< $(obj)/%.lds: $(src)/%.lds.S FORCE $(call if_changed_dep,cpp_lds_S)
scripts/gfp-translate +1 -1
@@ -73,7 +73,7 @@ echo Parsing: $GFPMASK #include <stdio.h> // Try to fool compiler.h into not including extra stuff -#define __ASSEMBLY__ 1 +#define __ASSEMBLER__ 1 #include <generated/autoconf.h> #include <linux/gfp_types.h>
scripts/headers_install.sh +0 -1
@@ -36,7 +36,6 @@ sed -E -e ' s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @ - s/__ASSEMBLY__/__ASSEMBLER__/g ' $INFILE > $TMPFILE || exit 1 scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE
scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py +1 -1
@@ -152,7 +152,7 @@ class TestSavedCmdParser(unittest.TestCase): self._assert_parsing(cmd, expected) def test_clang(self): - cmd = """clang -Wp,-MMD,arch/x86/entry/.entry_64_compat.o.d -nostdinc -I../arch/x86/include -I./arch/x86/include/generated -I../include -I./include -I../arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I../include/uapi -I./include/generated/uapi -include ../include/linux/compiler-version.h -include ../include/linux/kconfig.h -D__KERNEL__ --target=x86_64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -Werror=option-ignored -Werror=unused-command-line-argument -fmacro-prefix-map=../= -Werror -D__ASSEMBLY__ -fno-PIE -m64 -I../arch/x86/entry -Iarch/x86/entry -DKBUILD_MODFILE='"arch/x86/entry/entry_64_compat"' -DKBUILD_MODNAME='"entry_64_compat"' -D__KBUILD_MODNAME=kmod_entry_64_compat -c -o arch/x86/entry/entry_64_compat.o ../arch/x86/entry/entry_64_compat.S""" + cmd = """clang -Wp,-MMD,arch/x86/entry/.entry_64_compat.o.d -nostdinc -I../arch/x86/include -I./arch/x86/include/generated -I../include -I./include -I../arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I../include/uapi -I./include/generated/uapi -include ../include/linux/compiler-version.h -include ../include/linux/kconfig.h -D__KERNEL__ --target=x86_64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -Werror=option-ignored -Werror=unused-command-line-argument -fmacro-prefix-map=../= -Werror -fno-PIE -m64 -I../arch/x86/entry -Iarch/x86/entry -DKBUILD_MODFILE='"arch/x86/entry/entry_64_compat"' -DKBUILD_MODNAME='"entry_64_compat"' -D__KBUILD_MODNAME=kmod_entry_64_compat -c -o arch/x86/entry/entry_64_compat.o ../arch/x86/entry/entry_64_compat.S""" expected = "../arch/x86/entry/entry_64_compat.S" self._assert_parsing(cmd, expected)
tools/testing/selftests/kvm/lib/riscv/handlers.S +0 -4
@@ -3,10 +3,6 @@ * Copyright (c) 2023 Intel Corporation */ -#ifndef __ASSEMBLY__ -#define __ASSEMBLY__ -#endif - #include <asm/csr.h> .macro save_context
tools/testing/selftests/vDSO/vgetrandom-chacha.S +0 -2
@@ -3,8 +3,6 @@ * Copyright (C) 2024 Jason A. Donenfeld <[email protected]>. All Rights Reserved. */ -#define __ASSEMBLY__ - #if defined(__aarch64__) #include "../../../../arch/arm64/kernel/vdso/vgetrandom-chacha.S" #elif defined(__loongarch__)
Signature · 1 line
2.56.0
[email protected]
AI reviewRe: [PATCH v5 13/13] treewide: Stop defining __ASSEMBLY__ for assembler files
Sashiko has reviewed this patch and found no issues.
Quoted 5 lines
All spots have been changed to
__ASSEMBLER__(i.e. the macro that gets defined by the compiler), so we don't have to manually define__ASSEMBLY__anymore.Signed-off-by Thomas Huth <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=13
Re: [PATCH v5 12/13] include: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
In reply to Thomas HuthQuoted 10 lines · Thomas Huth
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 completely mechanical patch (done with a simple "sed -i" statement).
For future patch submissions, please include the command that has been used to modify the code in the patch description. Anyway:
On 2026-10-23 08:48:37+0200, Thomas Huth wrote:
(...)
Quoted 4 lines
I split the patches per architecture / maintained subsystem to ease the review, and I also split the uapi headers from the normal ones in case we ever decide that uapi needs to be treated differently from the normal headers here and the patches would need to get reverted.
Nit:
The UAPI split doesn't really matter anymore, now that scripts/headers_install.sh normalizes all UAPI headers.
(...)
Thomas
Arnd Bergmann
maintainerQuoted 20 lines · Thomas Huth
The kernel Makefiles define the
__ASSEMBLY__macro to provide a way to use headers in both, assembly and C source code. However, all the supported versions of the GCC and Clang compilers (and also other compilers like Tiny-C or PCC) define the macro__ASSEMBLER__automatically already when compiling assembly code, too, so some kernel headers are using__ASSEMBLER__instead. With regards to userspace code, this seems also to be constant source of confusion, see for example these links here:https://lore.kernel.org/kvm/[email protected]/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199To avoid confusion in the future, it makes sense to standardize on the macro that gets defined by the compiler, so this patch series changes all occurrences of
__ASSEMBLY__into__ASSEMBLER__and finally removes the -D__ASSEMBLY__ from the Makefiles.
Quoted 4 lines
I split the patches per architecture / maintained subsystem to ease the review, and I also split the uapi headers from the normal ones in case we ever decide that uapi needs to be treated differently from the normal headers here and the patches would need to get reverted.
I have started an asm-generic branch[1] for 7.5 based on today's mainline snapshot and applied the series. I'll rebase once more after -rc1 is out to ensure this can be tested in linux-next.
Thanks a lot for getting this finished!
Arnd
[1] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git/log/?h=asm-generic
Re: [PATCH v5 13/13] treewide: Stop defining __ASSEMBLY__ for assembler files
In reply to Thomas HuthQuoted 20 lines · Thomas Huth
All spots have been changed to
__ASSEMBLER__(i.e. the macro that gets defined by the compiler), so we don't have to manually define__ASSEMBLY__anymore.Signed-off-by Thomas Huth <[email protected]>--- Makefile | 2 +- arch/alpha/boot/compressed/Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 1 - arch/loongarch/vdso/Makefile | 2 +- arch/mips/boot/compressed/Makefile | 2 +- arch/mips/vdso/Makefile | 2 +- arch/powerpc/boot/Makefile | 2 +- arch/powerpc/platforms/cell/spufs/Makefile | 2 +- arch/s390/Makefile | 2 +- arch/x86/boot/Makefile | 2 +- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/realmode/rm/Makefile | 2 +- arch/xtensa/kernel/Makefile | 2 +- drivers/firmware/efi/libstub/Makefile | 2 +-
Quoted 9 lines
drivers/net/wan/Makefile | 2 +- scripts/Makefile.build | 2 +- scripts/gfp-translate | 2 +- scripts/headers_install.sh | 1 - scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py | 2 +- tools/testing/selftests/kvm/lib/riscv/handlers.S | 4 ---- tools/testing/selftests/vDSO/vgetrandom-chacha.S | 2 -- 21 files changed, 17 insertions(+), 25 deletions(-)