diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2009-01-03 00:31:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-03 00:31:58 -0500 |
commit | fffeeb413704b742dd1d08a3b5a0070a72ab52e1 (patch) | |
tree | 4eb8c70ac6d8bf2973d29665f175bfc9b12497f3 /arch/sparc | |
parent | 2ef4c01e180902a0197f959f84d4ae1d8eb18888 (diff) |
sparc: fix warnings in userspace header byteorder.h
Fix following warnings in byteorder.h:
byteorder.h:4: include of <linux/types.h> is preferred over <asm/types.h>
byteorder.h:9: leaks CONFIG_SPARC32 to userspace where it is not valid
byteorder.h:13: leaks CONFIG_SPARC64 to userspace where it is not valid
byteorder.h:14: found __[us]{8,16,32,64} type without #include <linux/types.h>
byteorder.h:47: leaks CONFIG_SPARC64 to userspace where it is not valid
- changed to use include <linux/types.h> as suggested
- use preprocessor defined symbols to distingush between 32 and 64 bit
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/byteorder.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h index 5a70f137f1f7..738414b26558 100644 --- a/arch/sparc/include/asm/byteorder.h +++ b/arch/sparc/include/asm/byteorder.h | |||
@@ -1,16 +1,12 @@ | |||
1 | #ifndef _SPARC_BYTEORDER_H | 1 | #ifndef _SPARC_BYTEORDER_H |
2 | #define _SPARC_BYTEORDER_H | 2 | #define _SPARC_BYTEORDER_H |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <linux/types.h> |
5 | #include <asm/asi.h> | 5 | #include <asm/asi.h> |
6 | 6 | ||
7 | #define __BIG_ENDIAN | 7 | #define __BIG_ENDIAN |
8 | 8 | ||
9 | #ifdef CONFIG_SPARC32 | 9 | #if defined(__sparc__) && defined(__arch64__) |
10 | #define __SWAB_64_THRU_32__ | ||
11 | #endif | ||
12 | |||
13 | #ifdef CONFIG_SPARC64 | ||
14 | static inline __u16 __arch_swab16p(const __u16 *addr) | 10 | static inline __u16 __arch_swab16p(const __u16 *addr) |
15 | { | 11 | { |
16 | __u16 ret; | 12 | __u16 ret; |
@@ -44,7 +40,9 @@ static inline __u64 __arch_swab64p(const __u64 *addr) | |||
44 | } | 40 | } |
45 | #define __arch_swab64p __arch_swab64p | 41 | #define __arch_swab64p __arch_swab64p |
46 | 42 | ||
47 | #endif /* CONFIG_SPARC64 */ | 43 | #else |
44 | #define __SWAB_64_THRU_32__ | ||
45 | #endif /* defined(__sparc__) && defined(__arch64__) */ | ||
48 | 46 | ||
49 | #include <linux/byteorder.h> | 47 | #include <linux/byteorder.h> |
50 | 48 | ||