Skip to contentSkip to conversation

sparc: fix warnings in userspace header byteorder.h

PATCH Applied Sam Ravnborg 2 participants 2 messages Jan 1, 2009 – Jan 3, 2009 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 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

---
 arch/sparc/include/asm/byteorder.h |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
arch/sparc/include/asm/byteorder.h +5 -7
index 5a70f13..738414b 100644
@@ -1,16 +1,12 @@
 #ifndef _SPARC_BYTEORDER_H
 #define _SPARC_BYTEORDER_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <asm/asi.h>
 
 #define __BIG_ENDIAN
 
-#ifdef CONFIG_SPARC32
-#define __SWAB_64_THRU_32__
-#endif
-
-#ifdef CONFIG_SPARC64
+#if defined(__sparc__) && defined(__arch64__)
 static inline __u16 __arch_swab16p(const __u16 *addr)
 {
 	__u16 ret;
@@ -44,7 +40,9 @@ static inline __u64 __arch_swab64p(const __u64 *addr)
 }
 #define __arch_swab64p __arch_swab64p
 
-#endif /* CONFIG_SPARC64 */
+#else
+#define __SWAB_64_THRU_32__
+#endif /* defined(__sparc__) && defined(__arch64__) */
 
 #include <linux/byteorder.h>
 
Signature · 1 line
1.6.0.2.GIT
maintainer Applied
#1 lore raw

From: Sam Ravnborg <[email protected]>
Date: Thu, 1 Jan 2009 23:40:28 +0100

Quoted 8 lines

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

Quoted 4 lines

- changed to use include <linux/types.h> as suggested
- use preprocessor defined symbols to distingush between 32 and 64 bit

Applied.