Skip to content

Commit e12b090

Browse files
Christoph HellwigRich Felker
authored andcommitted
sh: remove __KERNEL__ ifdefs from non-UAPI headers
There is no point in having __KERNEL__ ifdefs in headers not exported to userspace. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Rich Felker <[email protected]>
1 parent 582dc53 commit e12b090

19 files changed

+0
-54
lines changed

arch/sh/include/asm/adc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
#ifndef __ASM_ADC_H
33
#define __ASM_ADC_H
4-
#ifdef __KERNEL__
54
/*
65
* Copyright (C) 2004 Andriy Skulysh
76
*/
@@ -10,5 +9,4 @@
109

1110
int adc_single(unsigned int channel);
1211

13-
#endif /* __KERNEL__ */
1412
#endif /* __ASM_ADC_H */

arch/sh/include/asm/addrspace.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#ifndef __ASM_SH_ADDRSPACE_H
88
#define __ASM_SH_ADDRSPACE_H
99

10-
#ifdef __KERNEL__
11-
1210
#include <cpu/addrspace.h>
1311

1412
/* If this CPU supports segmentation, hook up the helpers */
@@ -62,5 +60,4 @@
6260
#define P3_ADDR_MAX P4SEG
6361
#endif
6462

65-
#endif /* __KERNEL__ */
6663
#endif /* __ASM_SH_ADDRSPACE_H */

arch/sh/include/asm/bitops.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef __ASM_SH_BITOPS_H
33
#define __ASM_SH_BITOPS_H
44

5-
#ifdef __KERNEL__
6-
75
#ifndef _LINUX_BITOPS_H
86
#error only <linux/bitops.h> can be included directly
97
#endif
@@ -71,6 +69,4 @@ static inline unsigned long __ffs(unsigned long word)
7169
#include <asm-generic/bitops/__fls.h>
7270
#include <asm-generic/bitops/fls64.h>
7371

74-
#endif /* __KERNEL__ */
75-
7672
#endif /* __ASM_SH_BITOPS_H */

arch/sh/include/asm/cache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
#ifndef __ASM_SH_CACHE_H
1010
#define __ASM_SH_CACHE_H
11-
#ifdef __KERNEL__
1211

1312
#include <linux/init.h>
1413
#include <cpu/cache.h>
@@ -44,5 +43,4 @@ struct cache_info {
4443
unsigned long flags;
4544
};
4645
#endif /* __ASSEMBLY__ */
47-
#endif /* __KERNEL__ */
4846
#endif /* __ASM_SH_CACHE_H */

arch/sh/include/asm/cacheflush.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef __ASM_SH_CACHEFLUSH_H
33
#define __ASM_SH_CACHEFLUSH_H
44

5-
#ifdef __KERNEL__
6-
75
#include <linux/mm.h>
86

97
/*
@@ -109,5 +107,4 @@ static inline void *sh_cacheop_vaddr(void *vaddr)
109107
return vaddr;
110108
}
111109

112-
#endif /* __KERNEL__ */
113110
#endif /* __ASM_SH_CACHEFLUSH_H */

arch/sh/include/asm/dma.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
#ifndef __ASM_SH_DMA_H
88
#define __ASM_SH_DMA_H
9-
#ifdef __KERNEL__
109

1110
#include <linux/spinlock.h>
1211
#include <linux/wait.h>
@@ -144,5 +143,4 @@ extern int isa_dma_bridge_buggy;
144143
#define isa_dma_bridge_buggy (0)
145144
#endif
146145

147-
#endif /* __KERNEL__ */
148146
#endif /* __ASM_SH_DMA_H */

arch/sh/include/asm/elf.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ typedef struct user_fpu_struct elf_fpregset_t;
9090
#endif
9191
#define ELF_ARCH EM_SH
9292

93-
#ifdef __KERNEL__
9493
/*
9594
* This is used to ensure we don't load something for the wrong architecture.
9695
*/
@@ -209,5 +208,4 @@ do { \
209208
NEW_AUX_ENT(AT_L2_CACHESHAPE, l2_cache_shape); \
210209
} while (0)
211210

212-
#endif /* __KERNEL__ */
213211
#endif /* __ASM_SH_ELF_H */

arch/sh/include/asm/freq.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
*/
77
#ifndef __ASM_SH_FREQ_H
88
#define __ASM_SH_FREQ_H
9-
#ifdef __KERNEL__
109

1110
#include <cpu/freq.h>
1211

13-
#endif /* __KERNEL__ */
1412
#endif /* __ASM_SH_FREQ_H */

arch/sh/include/asm/futex.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef __ASM_SH_FUTEX_H
33
#define __ASM_SH_FUTEX_H
44

5-
#ifdef __KERNEL__
6-
75
#include <linux/futex.h>
86
#include <linux/uaccess.h>
97
#include <asm/errno.h>
@@ -71,5 +69,4 @@ static inline int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval,
7169
return ret;
7270
}
7371

74-
#endif /* __KERNEL__ */
7572
#endif /* __ASM_SH_FUTEX_H */

arch/sh/include/asm/io.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/pgtable.h>
2121
#include <asm-generic/iomap.h>
2222

23-
#ifdef __KERNEL__
2423
#define __IO_PREFIX generic
2524
#include <asm/io_generic.h>
2625
#include <asm/io_trapped.h>
@@ -380,6 +379,4 @@ static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
380379
int valid_phys_addr_range(phys_addr_t addr, size_t size);
381380
int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
382381

383-
#endif /* __KERNEL__ */
384-
385382
#endif /* __ASM_SH_IO_H */

arch/sh/include/asm/mmu_context.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#ifndef __ASM_SH_MMU_CONTEXT_H
99
#define __ASM_SH_MMU_CONTEXT_H
1010

11-
#ifdef __KERNEL__
1211
#include <cpu/mmu_context.h>
1312
#include <asm/tlbflush.h>
1413
#include <linux/uaccess.h>
@@ -177,5 +176,4 @@ static inline void disable_mmu(void)
177176
#define disable_mmu() do { } while (0)
178177
#endif
179178

180-
#endif /* __KERNEL__ */
181179
#endif /* __ASM_SH_MMU_CONTEXT_H */

arch/sh/include/asm/mmzone.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef __ASM_SH_MMZONE_H
33
#define __ASM_SH_MMZONE_H
44

5-
#ifdef __KERNEL__
6-
75
#ifdef CONFIG_NEED_MULTIPLE_NODES
86
#include <linux/numa.h>
97

@@ -44,5 +42,4 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
4442
/* arch/sh/mm/init.c */
4543
void __init allocate_pgdat(unsigned int nid);
4644

47-
#endif /* __KERNEL__ */
4845
#endif /* __ASM_SH_MMZONE_H */

arch/sh/include/asm/pci.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef __ASM_SH_PCI_H
33
#define __ASM_SH_PCI_H
44

5-
#ifdef __KERNEL__
6-
75
/* Can be used to override the logic in pci_scan_bus for skipping
86
already-configured bus numbers - to be used for buggy BIOSes
97
or architectures with incomplete PCI setup by the loader */
@@ -96,6 +94,4 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
9694
return channel ? 15 : 14;
9795
}
9896

99-
#endif /* __KERNEL__ */
10097
#endif /* __ASM_SH_PCI_H */
101-

arch/sh/include/asm/processor_32.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#ifndef __ASM_SH_PROCESSOR_32_H
1010
#define __ASM_SH_PROCESSOR_32_H
11-
#ifdef __KERNEL__
1211

1312
#include <linux/compiler.h>
1413
#include <linux/linkage.h>
@@ -203,5 +202,4 @@ static inline void prefetchw(const void *x)
203202
}
204203
#endif
205204

206-
#endif /* __KERNEL__ */
207205
#endif /* __ASM_SH_PROCESSOR_32_H */

arch/sh/include/asm/sparsemem.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#ifndef __ASM_SH_SPARSEMEM_H
33
#define __ASM_SH_SPARSEMEM_H
44

5-
#ifdef __KERNEL__
65
/*
76
* SECTION_SIZE_BITS 2^N: how big each section will be
87
* MAX_PHYSADDR_BITS 2^N: how much physical address space we have
@@ -12,6 +11,4 @@
1211
#define MAX_PHYSADDR_BITS 32
1312
#define MAX_PHYSMEM_BITS 32
1413

15-
#endif
16-
1714
#endif /* __ASM_SH_SPARSEMEM_H */

arch/sh/include/asm/string_32.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef __ASM_SH_STRING_H
33
#define __ASM_SH_STRING_H
44

5-
#ifdef __KERNEL__
6-
75
/*
86
* Copyright (C) 1999 Niibe Yutaka
97
* But consider these trivial functions to be public domain.
@@ -127,6 +125,4 @@ extern void *memchr(const void *__s, int __c, size_t __n);
127125
#define __HAVE_ARCH_STRLEN
128126
extern size_t strlen(const char *);
129127

130-
#endif /* __KERNEL__ */
131-
132128
#endif /* __ASM_SH_STRING_H */

arch/sh/include/asm/syscalls_32.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef __ASM_SH_SYSCALLS_32_H
33
#define __ASM_SH_SYSCALLS_32_H
44

5-
#ifdef __KERNEL__
6-
75
#include <linux/compiler.h>
86
#include <linux/linkage.h>
97
#include <linux/types.h>
@@ -26,5 +24,4 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
2624
asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
2725
unsigned long thread_info_flags);
2826

29-
#endif /* __KERNEL__ */
3027
#endif /* __ASM_SH_SYSCALLS_32_H */

arch/sh/include/asm/thread_info.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* Copyright (C) 2002 David Howells ([email protected])
1111
* - Incorporating suggestions made by Linus Torvalds and Dave Miller
1212
*/
13-
#ifdef __KERNEL__
14-
1513
#include <asm/page.h>
1614

1715
/*
@@ -170,7 +168,4 @@ static inline unsigned int get_thread_fault_code(void)
170168
}
171169

172170
#endif /* !__ASSEMBLY__ */
173-
174-
#endif /* __KERNEL__ */
175-
176171
#endif /* __ASM_SH_THREAD_INFO_H */

arch/sh/include/asm/watchdog.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
#ifndef __ASM_SH_WATCHDOG_H
1010
#define __ASM_SH_WATCHDOG_H
11-
#ifdef __KERNEL__
1211

1312
#include <linux/types.h>
1413
#include <linux/io.h>
@@ -157,5 +156,4 @@ static inline void sh_wdt_write_csr(__u8 val)
157156
__raw_writew((WTCSR_HIGH << 8) | (__u16)val, WTCSR);
158157
}
159158
#endif /* CONFIG_CPU_SUBTYPE_SH7785 || CONFIG_CPU_SUBTYPE_SH7780 */
160-
#endif /* __KERNEL__ */
161159
#endif /* __ASM_SH_WATCHDOG_H */

0 commit comments

Comments
 (0)