x86: mostly merge types.h
PATCH 1/1 x86: mostly merge types.h
From: Chris Snook <[email protected]>
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.
types.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ types_32.h | 48 ++++++------------------------------------------ types_64.h | 47 +++++++---------------------------------------- 3 files changed, 58 insertions(+), 82 deletions(-)
include/asm-x86/types_32.h +6 -42
@@ -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. */ - +/* DMA addresses come in generic and 64-bit flavours. */ #ifdef CONFIG_HIGHMEM64G typedef u64 dma_addr_t ;#else typedef u32 dma_addr_t ;#endif -typedef u64 dma64_addr_t ;#endif /* __ASSEMBLY__ */ -#endif /* __KERNEL__ */ - -#endif +#endif /* _I386_TYPES_H */
include/asm-x86/types_64.h +7 -40
62 lines not on this page · raw message
include/asm-x86/types.h +45 -0
51 lines not on this page · raw message
Quoted 5 lines · Chris Snook
From: Chris Snook <[email protected]>
Most of
types_32.handtypes_64.hare the same. Merge the common definitions intotypes.h, keeping the differences in their own files. Also #error if types_{32,64}.h is included directly. Tested with allmodconfig onx86_64.
Sorry, your patch is late:
And we really want to eliminate the _32/64 variants completely when ever it is possible.
Thanks,
tglx