UAPI: Split trivial #if defined(__KERNEL__) && X conditionals
authorDavid Howells <dhowells@redhat.com>
Tue, 13 Dec 2011 15:07:49 +0000 (15:07 +0000)
committerDavid Howells <dhowells@redhat.com>
Tue, 13 Dec 2011 15:07:49 +0000 (15:07 +0000)
Split trivial #if defined(__KERNEL__) && X conditionals to make automated
disintegration easier.

Signed-off-by: David Howells <dhowells@redhat.com>
arch/arm/include/asm/hwcap.h
arch/arm/include/asm/swab.h
arch/arm/include/asm/unistd.h
arch/ia64/include/asm/intrinsics.h
arch/mips/include/asm/types.h
arch/s390/include/asm/mman.h
arch/tile/include/asm/signal.h
include/linux/mroute6.h

index c93a22a8b924737730edaf17ef3e5ceb7b94afc5..917626128a1da7d326f6816ae63c1495a0290bc3 100644 (file)
@@ -25,7 +25,8 @@
 #define HWCAP_IDIVT    (1 << 18)
 #define HWCAP_IDIV     (HWCAP_IDIVA | HWCAP_IDIVT)
 
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__KERNEL__)
+#if !defined(__ASSEMBLY__)
 /*
  * This yields a mask that user programs can use to figure out what
  * instruction set this cpu supports.
@@ -33,5 +34,6 @@
 #define ELF_HWCAP      (elf_hwcap)
 extern unsigned int elf_hwcap;
 #endif
+#endif
 
 #endif
index 9997ad20eff11d04906882b0a8da3c7c47ac4f76..e82adf64d1dd727e18dd0d54781323c98a9e5c20 100644 (file)
@@ -22,7 +22,8 @@
 #  define __SWAB_64_THRU_32__
 #endif
 
-#if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6
+#if defined(__KERNEL__)
+#if __LINUX_ARM_ARCH__ >= 6
 
 static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
 {
@@ -38,8 +39,10 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 }
 #define __arch_swab32 __arch_swab32
 
-#else
+#endif
+#endif
 
+#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 {
        __u32 t;
index 4a1123783806b79ef559ed51a093353feb67070e..512cd1473454c9ba26eaf51fbb659a313aad96b0 100644 (file)
 /*
  * The following syscalls are obsolete and no longer available for EABI.
  */
-#if defined(__ARM_EABI__) && !defined(__KERNEL__)
+#if !defined(__KERNEL__)
+#if defined(__ARM_EABI__)
 #undef __NR_time
 #undef __NR_umount
 #undef __NR_stime
 #undef __NR_syscall
 #undef __NR_ipc
 #endif
+#endif
 
 #ifdef __KERNEL__
 
index 111ed52228921cac226a8994e404e3100defb73c..e4076b511829572ad590d36e362f463f93e813d6 100644 (file)
@@ -201,16 +201,21 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void);
 #endif
 
 #ifndef __ASSEMBLY__
-#if defined(CONFIG_PARAVIRT) && defined(__KERNEL__)
-#ifdef ASM_SUPPORTED
-# define IA64_INTRINSIC_API(name)      paravirt_ ## name
-#else
-# define IA64_INTRINSIC_API(name)      pv_cpu_ops.name
-#endif
-#define IA64_INTRINSIC_MACRO(name)     paravirt_ ## name
-#else
+
 #define IA64_INTRINSIC_API(name)       ia64_native_ ## name
 #define IA64_INTRINSIC_MACRO(name)     ia64_native_ ## name
+
+#if defined(__KERNEL__)
+#if defined(CONFIG_PARAVIRT)
+# undef IA64_INTRINSIC_API
+# undef IA64_INTRINSIC_MACRO
+# ifdef ASM_SUPPORTED
+#  define IA64_INTRINSIC_API(name)     paravirt_ ## name
+# else
+#  define IA64_INTRINSIC_API(name)     pv_cpu_ops.name
+# endif
+#define IA64_INTRINSIC_MACRO(name)     paravirt_ ## name
+#endif
 #endif
 
 /************************************************/
index 533812b6188181ecea4503450e8eae5677ae920d..9b96461bc1e7e2bd625487b55ed11aa4bbb628cc 100644 (file)
  * We don't use int-l64.h for the kernel anymore but still use it for
  * userspace to avoid code changes.
  */
-#if (_MIPS_SZLONG == 64) && !defined(__KERNEL__)
-# include <asm-generic/int-l64.h>
-#else
+#ifdef __KERNEL__
 # include <asm-generic/int-ll64.h>
+#else
+# if _MIPS_SZLONG == 64
+#  include <asm-generic/int-l64.h>
+# else
+#  include <asm-generic/int-ll64.h>
+# endif
 #endif
 
 #ifndef __ASSEMBLY__
index 4e9c8ae0a6375211d10119c8be241ac1543c68d0..d49760e63506dd401df1e2f81da69982ed6a468c 100644 (file)
 
 #include <asm-generic/mman.h>
 
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
+#if defined(__KERNEL__)
+#if !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
 int s390_mmap_check(unsigned long addr, unsigned long len);
 #define arch_mmap_check(addr,len,flags)        s390_mmap_check(addr,len)
 #endif
+#endif
 
 #endif /* __S390_MMAN_H__ */
index 1e1e616783ebfdd50ba937df77391816026ecaff..1e5e49aad54877e5664f5a0d56964845f8ad4b76 100644 (file)
@@ -23,7 +23,8 @@
 
 #include <asm-generic/signal.h>
 
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__KERNEL__)
+#if !defined(__ASSEMBLY__)
 struct pt_regs;
 int restore_sigcontext(struct pt_regs *, struct sigcontext __user *);
 int setup_sigcontext(struct sigcontext __user *, struct pt_regs *);
@@ -33,5 +34,6 @@ void signal_fault(const char *type, struct pt_regs *,
 void trace_unhandled_signal(const char *type, struct pt_regs *regs,
                            unsigned long address, int signo);
 #endif
+#endif
 
 #endif /* _ASM_TILE_SIGNAL_H */
index a3759cb0ac10560bc58a30341d228041afcac8f7..6d8c7251eb8d4147968c6a146473868caa0eebbc 100644 (file)
@@ -43,9 +43,11 @@ typedef unsigned short mifi_t;
 typedef        __u32           if_mask;
 #define NIFBITS (sizeof(if_mask) * 8)        /* bits per mask */
 
-#if !defined(__KERNEL__) && !defined(DIV_ROUND_UP)
+#if !defined(__KERNEL__)
+#if !defined(DIV_ROUND_UP)
 #define        DIV_ROUND_UP(x,y)       (((x) + ((y) - 1)) / (y))
 #endif
+#endif
 
 typedef struct if_set {
        if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];