Re: [PATCH] x86: mostly merge types.h

Previous thread: BUG at mm/filemap.c:1749 (2.6.24, jffs2, unionfs) by Erez Zadok on Thursday, October 18, 2007 - 11:05 pm. (7 messages)

Next thread: Query about Bio submission / Direct IO by Shreyansh Jain on Thursday, October 18, 2007 - 11:17 pm. (3 messages)
From: Chris Snook
Date: Thursday, October 18, 2007 - 11:09 pm

From: Chris Snook <csnook@redhat.com>

Most of types_32.h and types_64.h are the same.  Merge the common definitions
into types.h, keeping the differences in their own files.  Also #error if
types_{32,64}.h is included directly.  Tested with allmodconfig on x86_64.

Signed-off-by: Chris Snook <csnook@redhat.com>

 types.h    |   45 +++++++++++++++++++++++++++++++++++++++++++++
 types_32.h |   48 ++++++------------------------------------------
 types_64.h |   47 +++++++----------------------------------------
 3 files changed, 58 insertions(+), 82 deletions(-)

diff -urp a/include/asm-x86/types_32.h b/include/asm-x86/types_32.h
--- a/include/asm-x86/types_32.h	2007-10-18 04:23:36.000000000 -0400
+++ b/include/asm-x86/types_32.h	2007-10-18 07:03:05.000000000 -0400
@@ -1,64 +1,28 @@
 #ifndef _I386_TYPES_H
 #define _I386_TYPES_H
 
-#ifndef __ASSEMBLY__
-
-typedef unsigned short umode_t;
-
-/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space
- */
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
+#ifndef _X86_TYPES_H
+#error Do not include this file directly.  Use asm/types.h instead.
+#endif
 
-#if defined(__GNUC__)
+#if !defined(__ASSEMBLY__) && defined(__GNUC__)
 __extension__ typedef __signed__ long long __s64;
 __extension__ typedef unsigned long long __u64;
 #endif
 
-#endif /* __ASSEMBLY__ */
-
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
 #ifdef __KERNEL__
 
 #define BITS_PER_LONG 32
 
 #ifndef __ASSEMBLY__
 
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-/* DMA addresses come in generic and 64-bit flavours.  ...
From: Thomas Gleixner
Date: Friday, October 19, 2007 - 12:02 am

Sorry, your patch is late:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d256ff51c...

And we really want to eliminate the _32/64 variants completely when
ever it is possible.

Thanks,

	tglx
-

Previous thread: BUG at mm/filemap.c:1749 (2.6.24, jffs2, unionfs) by Erez Zadok on Thursday, October 18, 2007 - 11:05 pm. (7 messages)

Next thread: Query about Bio submission / Direct IO by Shreyansh Jain on Thursday, October 18, 2007 - 11:17 pm. (3 messages)