Commit b907b80d authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon
Browse files

arm64: remove pointless __KERNEL__ guards



For a number of years, UAPI headers have been split from kernel-internal
headers. The latter are never exposed to userspace, and always built
with __KERNEL__ defined.

Most headers under arch/arm64 don't have __KERNEL__ guards, but there
are a few stragglers lying around. To make things more consistent, and
to set a good example going forward, let's remove these redundant
__KERNEL__ guards.

In a couple of cases, a trailing #endif lacked a comment describing its
corresponding #if or #ifdef, so these are fixes up at the same time.

Guards in auto-generated crypto code are left as-is, as these guards are
generated by scripting imported from the upstream openssl project
scripts. Guards in UAPI headers are left as-is, as these can be included
by userspace or the kernel.

There should be no functional change as a result of this patch.

Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent c8785794
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
#include <asm/barrier.h>
#include <asm/lse.h>

#ifdef __KERNEL__

#define __ARM64_IN_ATOMIC_IMPL

#if defined(CONFIG_ARM64_LSE_ATOMICS) && defined(CONFIG_AS_LSE)
@@ -157,5 +155,4 @@

#include <asm-generic/atomic-instrumented.h>

#endif
#endif
#endif /* __ASM_ATOMIC_H */
+0 −2
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
 */
#ifndef __ASM_COMPAT_H
#define __ASM_COMPAT_H
#ifdef __KERNEL__
#ifdef CONFIG_COMPAT

/*
@@ -215,5 +214,4 @@ static inline int is_compat_thread(struct thread_info *thread)
}

#endif /* CONFIG_COMPAT */
#endif /* __KERNEL__ */
#endif /* __ASM_COMPAT_H */
+0 −3
Original line number Diff line number Diff line
@@ -5,8 +5,6 @@
#ifndef __ASM_DEBUG_MONITORS_H
#define __ASM_DEBUG_MONITORS_H

#ifdef __KERNEL__

#include <linux/errno.h>
#include <linux/types.h>
#include <asm/brk-imm.h>
@@ -128,5 +126,4 @@ static inline int reinstall_suspended_bps(struct pt_regs *regs)
int aarch32_break_handler(struct pt_regs *regs);

#endif	/* __ASSEMBLY */
#endif	/* __KERNEL__ */
#endif	/* __ASM_DEBUG_MONITORS_H */
+0 −3
Original line number Diff line number Diff line
@@ -5,8 +5,6 @@
#ifndef __ASM_DMA_MAPPING_H
#define __ASM_DMA_MAPPING_H

#ifdef __KERNEL__

#include <linux/types.h>
#include <linux/vmalloc.h>

@@ -27,5 +25,4 @@ static inline bool is_device_dma_coherent(struct device *dev)
	return dev->dma_coherent;
}

#endif	/* __KERNEL__ */
#endif	/* __ASM_DMA_MAPPING_H */
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <linux/stddef.h>
#include <linux/types.h>

#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
#ifdef CONFIG_COMPAT
/* Masks for extracting the FPSR and FPCR from the FPSCR */
#define VFP_FPSCR_STAT_MASK	0xf800009f
#define VFP_FPSCR_CTRL_MASK	0x07f79f00
Loading