Skip to contentSkip to conversation

include/asm-i386/byteorder.h: ANSI mode fixes

PATCH In review Daniel Richard G. 2 participants 2 messages Dec 17, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 include/asm-i386/byteorder.h: ANSI mode fixes

This header file uses inline' where it should use __inline__', asm' where it should use __asm__'. GCC with -ansi barfs if it sees these keywords without the double underscores. Headaches for the KDE folks:

	http://bugs.kde.org/show_bug.cgi?id=67269
	http://bugs.kde.org/show_bug.cgi?id=70100

(Note that the header already uses __inline__ and __asm__ for the most part---this patch addresses the three remaining exceptions.)

Patch applies equally against latest 2.4.23(bk12) and 2.6.0-test11(bk12) revs; the header file is identical in both.

Please Cc: me on any replies.

--------BEGIN PATCH--------

asm-i386/byteorder.h renamed from asm-i386/byteorder.h.orig +6 -6
@@ -35,7 +35,7 @@
 }
 
 
-static inline __u64 ___arch__swab64(__u64 val) 
+static __inline__ __u64 ___arch__swab64(__u64 val) 
 { 
 	union { 
 		struct { __u32 a,b; } s;
@@ -43,13 +43,13 @@
 	} v;
 	v.u = val;
 #ifdef CONFIG_X86_BSWAP
-	asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1" 
-	    : "=r" (v.s.a), "=r" (v.s.b) 
-	    : "0" (v.s.a), "1" (v.s.b)); 
+	__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" 
+	        : "=r" (v.s.a), "=r" (v.s.b) 
+	        : "0" (v.s.a), "1" (v.s.b)); 
 #else
-   v.s.a = ___arch__swab32(v.s.a); 
+	v.s.a = ___arch__swab32(v.s.a); 
 	v.s.b = ___arch__swab32(v.s.b); 
-	asm("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
+	__asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
 #endif
 	return v.u;	
 } 

--------END PATCH--------

--Danny

Signature · 4 lines
NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = [email protected]        ##  don't smell bad---    (/o|o\) /
EMAIL2 = [email protected]      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
#1 lore raw
Quoted 3 lines · Daniel Richard G.

This header file uses inline' where it should use __inline__', asm' where it should use __asm__'. GCC with -ansi barfs if it sees these keywords without the double underscores. Headaches for the KDE folks:

The kernel is not written in 'ansi C' but in gcc, mostly - not sure if you should expect kernel headers to function with -ansi.

Signature · 2 lines
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO