Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

UAPI: Split trivial #if defined(__KERNEL__) && X conditionals

Split trivial #if defined(__KERNEL__) && X conditionals to make automated
disintegration easier.

Signed-off-by: David Howells <dhowells@redhat.com>

+40 -18
+3 -1
arch/arm/include/asm/hwcap.h
··· 25 25 #define HWCAP_IDIVT (1 << 18) 26 26 #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) 27 27 28 - #if defined(__KERNEL__) && !defined(__ASSEMBLY__) 28 + #if defined(__KERNEL__) 29 + #if !defined(__ASSEMBLY__) 29 30 /* 30 31 * This yields a mask that user programs can use to figure out what 31 32 * instruction set this cpu supports. 32 33 */ 33 34 #define ELF_HWCAP (elf_hwcap) 34 35 extern unsigned int elf_hwcap; 36 + #endif 35 37 #endif 36 38 37 39 #endif
+5 -2
arch/arm/include/asm/swab.h
··· 22 22 # define __SWAB_64_THRU_32__ 23 23 #endif 24 24 25 - #if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6 25 + #if defined(__KERNEL__) 26 + #if __LINUX_ARM_ARCH__ >= 6 26 27 27 28 static inline __attribute_const__ __u16 __arch_swab16(__u16 x) 28 29 { ··· 39 38 } 40 39 #define __arch_swab32 __arch_swab32 41 40 42 - #else 41 + #endif 42 + #endif 43 43 44 + #if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6 44 45 static inline __attribute_const__ __u32 __arch_swab32(__u32 x) 45 46 { 46 47 __u32 t;
+3 -1
arch/arm/include/asm/unistd.h
··· 427 427 /* 428 428 * The following syscalls are obsolete and no longer available for EABI. 429 429 */ 430 - #if defined(__ARM_EABI__) && !defined(__KERNEL__) 430 + #if !defined(__KERNEL__) 431 + #if defined(__ARM_EABI__) 431 432 #undef __NR_time 432 433 #undef __NR_umount 433 434 #undef __NR_stime ··· 441 440 #undef __NR_socketcall 442 441 #undef __NR_syscall 443 442 #undef __NR_ipc 443 + #endif 444 444 #endif 445 445 446 446 #ifdef __KERNEL__
+13 -8
arch/ia64/include/asm/intrinsics.h
··· 201 201 #endif 202 202 203 203 #ifndef __ASSEMBLY__ 204 - #if defined(CONFIG_PARAVIRT) && defined(__KERNEL__) 205 - #ifdef ASM_SUPPORTED 206 - # define IA64_INTRINSIC_API(name) paravirt_ ## name 207 - #else 208 - # define IA64_INTRINSIC_API(name) pv_cpu_ops.name 209 - #endif 210 - #define IA64_INTRINSIC_MACRO(name) paravirt_ ## name 211 - #else 204 + 212 205 #define IA64_INTRINSIC_API(name) ia64_native_ ## name 213 206 #define IA64_INTRINSIC_MACRO(name) ia64_native_ ## name 207 + 208 + #if defined(__KERNEL__) 209 + #if defined(CONFIG_PARAVIRT) 210 + # undef IA64_INTRINSIC_API 211 + # undef IA64_INTRINSIC_MACRO 212 + # ifdef ASM_SUPPORTED 213 + # define IA64_INTRINSIC_API(name) paravirt_ ## name 214 + # else 215 + # define IA64_INTRINSIC_API(name) pv_cpu_ops.name 216 + # endif 217 + #define IA64_INTRINSIC_MACRO(name) paravirt_ ## name 218 + #endif 214 219 #endif 215 220 216 221 /************************************************/
+7 -3
arch/mips/include/asm/types.h
··· 15 15 * We don't use int-l64.h for the kernel anymore but still use it for 16 16 * userspace to avoid code changes. 17 17 */ 18 - #if (_MIPS_SZLONG == 64) && !defined(__KERNEL__) 19 - # include <asm-generic/int-l64.h> 20 - #else 18 + #ifdef __KERNEL__ 21 19 # include <asm-generic/int-ll64.h> 20 + #else 21 + # if _MIPS_SZLONG == 64 22 + # include <asm-generic/int-l64.h> 23 + # else 24 + # include <asm-generic/int-ll64.h> 25 + # endif 22 26 #endif 23 27 24 28 #ifndef __ASSEMBLY__
+3 -1
arch/s390/include/asm/mman.h
··· 11 11 12 12 #include <asm-generic/mman.h> 13 13 14 - #if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT) 14 + #if defined(__KERNEL__) 15 + #if !defined(__ASSEMBLY__) && defined(CONFIG_64BIT) 15 16 int s390_mmap_check(unsigned long addr, unsigned long len); 16 17 #define arch_mmap_check(addr,len,flags) s390_mmap_check(addr,len) 18 + #endif 17 19 #endif 18 20 19 21 #endif /* __S390_MMAN_H__ */
+3 -1
arch/tile/include/asm/signal.h
··· 23 23 24 24 #include <asm-generic/signal.h> 25 25 26 - #if defined(__KERNEL__) && !defined(__ASSEMBLY__) 26 + #if defined(__KERNEL__) 27 + #if !defined(__ASSEMBLY__) 27 28 struct pt_regs; 28 29 int restore_sigcontext(struct pt_regs *, struct sigcontext __user *); 29 30 int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); ··· 33 32 void __user *frame, int sig); 34 33 void trace_unhandled_signal(const char *type, struct pt_regs *regs, 35 34 unsigned long address, int signo); 35 + #endif 36 36 #endif 37 37 38 38 #endif /* _ASM_TILE_SIGNAL_H */
+3 -1
include/linux/mroute6.h
··· 43 43 typedef __u32 if_mask; 44 44 #define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */ 45 45 46 - #if !defined(__KERNEL__) && !defined(DIV_ROUND_UP) 46 + #if !defined(__KERNEL__) 47 + #if !defined(DIV_ROUND_UP) 47 48 #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) 49 + #endif 48 50 #endif 49 51 50 52 typedef struct if_set {