diff options
author | David Howells <dhowells@redhat.com> | 2011-12-13 10:07:49 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2011-12-13 10:07:49 -0500 |
commit | 1632b9e2a14ce9f4e08faf6c4380431d63319bd3 (patch) | |
tree | 572e45a2de74d233af5d98242bafbd193e074f43 | |
parent | fdc29805bd7cae133303045fc0249d76f3827613 (diff) |
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>
-rw-r--r-- | arch/arm/include/asm/hwcap.h | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/swab.h | 7 | ||||
-rw-r--r-- | arch/arm/include/asm/unistd.h | 4 | ||||
-rw-r--r-- | arch/ia64/include/asm/intrinsics.h | 21 | ||||
-rw-r--r-- | arch/mips/include/asm/types.h | 10 | ||||
-rw-r--r-- | arch/s390/include/asm/mman.h | 4 | ||||
-rw-r--r-- | arch/tile/include/asm/signal.h | 4 | ||||
-rw-r--r-- | include/linux/mroute6.h | 4 |
8 files changed, 40 insertions, 18 deletions
diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h index c93a22a8b924..917626128a1d 100644 --- a/arch/arm/include/asm/hwcap.h +++ b/arch/arm/include/asm/hwcap.h | |||
@@ -25,7 +25,8 @@ | |||
25 | #define HWCAP_IDIVT (1 << 18) | 25 | #define HWCAP_IDIVT (1 << 18) |
26 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) | 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 | * This yields a mask that user programs can use to figure out what | 31 | * This yields a mask that user programs can use to figure out what |
31 | * instruction set this cpu supports. | 32 | * instruction set this cpu supports. |
@@ -33,5 +34,6 @@ | |||
33 | #define ELF_HWCAP (elf_hwcap) | 34 | #define ELF_HWCAP (elf_hwcap) |
34 | extern unsigned int elf_hwcap; | 35 | extern unsigned int elf_hwcap; |
35 | #endif | 36 | #endif |
37 | #endif | ||
36 | 38 | ||
37 | #endif | 39 | #endif |
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h index 9997ad20eff1..e82adf64d1dd 100644 --- a/arch/arm/include/asm/swab.h +++ b/arch/arm/include/asm/swab.h | |||
@@ -22,7 +22,8 @@ | |||
22 | # define __SWAB_64_THRU_32__ | 22 | # define __SWAB_64_THRU_32__ |
23 | #endif | 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 | static inline __attribute_const__ __u16 __arch_swab16(__u16 x) | 28 | static inline __attribute_const__ __u16 __arch_swab16(__u16 x) |
28 | { | 29 | { |
@@ -38,8 +39,10 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | |||
38 | } | 39 | } |
39 | #define __arch_swab32 __arch_swab32 | 40 | #define __arch_swab32 __arch_swab32 |
40 | 41 | ||
41 | #else | 42 | #endif |
43 | #endif | ||
42 | 44 | ||
45 | #if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6 | ||
43 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | 46 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) |
44 | { | 47 | { |
45 | __u32 t; | 48 | __u32 t; |
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index 4a1123783806..512cd1473454 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h | |||
@@ -427,7 +427,8 @@ | |||
427 | /* | 427 | /* |
428 | * The following syscalls are obsolete and no longer available for EABI. | 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 | #undef __NR_time | 432 | #undef __NR_time |
432 | #undef __NR_umount | 433 | #undef __NR_umount |
433 | #undef __NR_stime | 434 | #undef __NR_stime |
@@ -441,6 +442,7 @@ | |||
441 | #undef __NR_syscall | 442 | #undef __NR_syscall |
442 | #undef __NR_ipc | 443 | #undef __NR_ipc |
443 | #endif | 444 | #endif |
445 | #endif | ||
444 | 446 | ||
445 | #ifdef __KERNEL__ | 447 | #ifdef __KERNEL__ |
446 | 448 | ||
diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h index 111ed5222892..e4076b511829 100644 --- a/arch/ia64/include/asm/intrinsics.h +++ b/arch/ia64/include/asm/intrinsics.h | |||
@@ -201,16 +201,21 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void); | |||
201 | #endif | 201 | #endif |
202 | 202 | ||
203 | #ifndef __ASSEMBLY__ | 203 | #ifndef __ASSEMBLY__ |
204 | #if defined(CONFIG_PARAVIRT) && defined(__KERNEL__) | 204 | |
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 | ||
212 | #define IA64_INTRINSIC_API(name) ia64_native_ ## name | 205 | #define IA64_INTRINSIC_API(name) ia64_native_ ## name |
213 | #define IA64_INTRINSIC_MACRO(name) ia64_native_ ## name | 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 | #endif | 219 | #endif |
215 | 220 | ||
216 | /************************************************/ | 221 | /************************************************/ |
diff --git a/arch/mips/include/asm/types.h b/arch/mips/include/asm/types.h index 533812b61881..9b96461bc1e7 100644 --- a/arch/mips/include/asm/types.h +++ b/arch/mips/include/asm/types.h | |||
@@ -15,10 +15,14 @@ | |||
15 | * We don't use int-l64.h for the kernel anymore but still use it for | 15 | * We don't use int-l64.h for the kernel anymore but still use it for |
16 | * userspace to avoid code changes. | 16 | * userspace to avoid code changes. |
17 | */ | 17 | */ |
18 | #if (_MIPS_SZLONG == 64) && !defined(__KERNEL__) | 18 | #ifdef __KERNEL__ |
19 | # include <asm-generic/int-l64.h> | ||
20 | #else | ||
21 | # include <asm-generic/int-ll64.h> | 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 | #endif | 26 | #endif |
23 | 27 | ||
24 | #ifndef __ASSEMBLY__ | 28 | #ifndef __ASSEMBLY__ |
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h index 4e9c8ae0a637..d49760e63506 100644 --- a/arch/s390/include/asm/mman.h +++ b/arch/s390/include/asm/mman.h | |||
@@ -11,9 +11,11 @@ | |||
11 | 11 | ||
12 | #include <asm-generic/mman.h> | 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 | int s390_mmap_check(unsigned long addr, unsigned long len); | 16 | int s390_mmap_check(unsigned long addr, unsigned long len); |
16 | #define arch_mmap_check(addr,len,flags) s390_mmap_check(addr,len) | 17 | #define arch_mmap_check(addr,len,flags) s390_mmap_check(addr,len) |
17 | #endif | 18 | #endif |
19 | #endif | ||
18 | 20 | ||
19 | #endif /* __S390_MMAN_H__ */ | 21 | #endif /* __S390_MMAN_H__ */ |
diff --git a/arch/tile/include/asm/signal.h b/arch/tile/include/asm/signal.h index 1e1e616783eb..1e5e49aad548 100644 --- a/arch/tile/include/asm/signal.h +++ b/arch/tile/include/asm/signal.h | |||
@@ -23,7 +23,8 @@ | |||
23 | 23 | ||
24 | #include <asm-generic/signal.h> | 24 | #include <asm-generic/signal.h> |
25 | 25 | ||
26 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) | 26 | #if defined(__KERNEL__) |
27 | #if !defined(__ASSEMBLY__) | ||
27 | struct pt_regs; | 28 | struct pt_regs; |
28 | int restore_sigcontext(struct pt_regs *, struct sigcontext __user *); | 29 | int restore_sigcontext(struct pt_regs *, struct sigcontext __user *); |
29 | int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); | 30 | int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); |
@@ -33,5 +34,6 @@ void signal_fault(const char *type, struct pt_regs *, | |||
33 | void trace_unhandled_signal(const char *type, struct pt_regs *regs, | 34 | void trace_unhandled_signal(const char *type, struct pt_regs *regs, |
34 | unsigned long address, int signo); | 35 | unsigned long address, int signo); |
35 | #endif | 36 | #endif |
37 | #endif | ||
36 | 38 | ||
37 | #endif /* _ASM_TILE_SIGNAL_H */ | 39 | #endif /* _ASM_TILE_SIGNAL_H */ |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index a3759cb0ac10..6d8c7251eb8d 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -43,9 +43,11 @@ typedef unsigned short mifi_t; | |||
43 | typedef __u32 if_mask; | 43 | typedef __u32 if_mask; |
44 | #define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */ | 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 | #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) | 48 | #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) |
48 | #endif | 49 | #endif |
50 | #endif | ||
49 | 51 | ||
50 | typedef struct if_set { | 52 | typedef struct if_set { |
51 | if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; | 53 | if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; |