Skip to contentSkip to conversation

Cleanup bitfield endianess mess

PATCH New Brian Gerst 1 participant 1 message Nov 3, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cleanup bitfield endianess mess

This patch defines new BITFIELDx macros to clean up the #ifdef mess with bitfields, and starts the conversion off with the IDE/ATAPI files.

--
Brian Gerst

drivers/atm/fore200e.h +0 -18
diff -urN linux-2.5.45-bk1/drivers/atm/fore200e.h linux/drivers/atm/fore200e.h
@@ -64,24 +64,6 @@
 #define FORE200E_DEV(d)          ((struct fore200e*)((d)->dev_data))
 #define FORE200E_VCC(d)          ((struct fore200e_vcc*)((d)->dev_data))
 
-/* bitfields endian games */
-
-#if defined(__LITTLE_ENDIAN_BITFIELD)
-#define BITFIELD2(b1, b2)                    b1; b2;
-#define BITFIELD3(b1, b2, b3)                b1; b2; b3;
-#define BITFIELD4(b1, b2, b3, b4)            b1; b2; b3; b4;
-#define BITFIELD5(b1, b2, b3, b4, b5)        b1; b2; b3; b4; b5;
-#define BITFIELD6(b1, b2, b3, b4, b5, b6)    b1; b2; b3; b4; b5; b6;
-#elif defined(__BIG_ENDIAN_BITFIELD)
-#define BITFIELD2(b1, b2)                                    b2; b1;
-#define BITFIELD3(b1, b2, b3)                            b3; b2; b1;
-#define BITFIELD4(b1, b2, b3, b4)                    b4; b3; b2; b1;
-#define BITFIELD5(b1, b2, b3, b4, b5)            b5; b4; b3; b2; b1;
-#define BITFIELD6(b1, b2, b3, b4, b5, b6)    b6; b5; b4; b3; b2; b1;
-#else
-#error unknown bitfield endianess
-#endif
-
  
 /* ATM cell header (minus HEC byte) */
 
drivers/ide/ide-cd.h +121 -251

405 lines not on this page · raw message

drivers/ide/ide-floppy.c +67 -123

234 lines not on this page · raw message

include/linux/atapi.h +90 -176

333 lines not on this page · raw message

Binary files linux-2.5.45-bk1/include/linux/byteorder/.big_endian.h.swp and linux/include/linux/byteorder/.big_endian.h.swp differ

include/linux/byteorder/big_endian.h +8 -0
diff -urN linux-2.5.45-bk1/include/linux/byteorder/big_endian.h linux/include/linux/byteorder/big_endian.h
@@ -65,4 +65,12 @@
 
 #include <linux/byteorder/generic.h>
 
+#define BITFIELD2(b1, b2)							b2; b1;
+#define BITFIELD3(b1, b2, b3)						    b3; b2; b1;
+#define BITFIELD4(b1, b2, b3, b4)					b4; b3; b2; b1;
+#define BITFIELD5(b1, b2, b3, b4, b5)				    b5; b4; b3; b2; b1;
+#define BITFIELD6(b1, b2, b3, b4, b5, b6)			b6; b5; b4; b3; b2; b1;
+#define BITFIELD7(b1, b2, b3, b4, b5, b6, b7)		    b7; b6; b5; b4; b3; b2; b1;
+#define BITFIELD8(b1, b2, b3, b4, b5, b6, b7, b8)	b8; b7; b6; b5; b4; b3; b2; b1;
+
 #endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
include/linux/byteorder/little_endian.h +8 -0
diff -urN linux-2.5.45-bk1/include/linux/byteorder/little_endian.h linux/include/linux/byteorder/little_endian.h
@@ -65,4 +65,12 @@
 
 #include <linux/byteorder/generic.h>
 
+#define BITFIELD2(b1, b2)				b1; b2;
+#define BITFIELD3(b1, b2, b3)				b1; b2; b3;
+#define BITFIELD4(b1, b2, b3, b4)			b1; b2; b3; b4;
+#define BITFIELD5(b1, b2, b3, b4, b5)			b1; b2; b3; b4; b5;
+#define BITFIELD6(b1, b2, b3, b4, b5, b6)		b1; b2; b3; b4; b5; b6;
+#define BITFIELD7(b1, b2, b3, b4, b5, b6, b7)		b1; b2; b3; b4; b5; b6; b7;
+#define BITFIELD8(b1, b2, b3, b4, b5, b6, b7, b8)	b1; b2; b3; b4; b5; b6; b7; b8;
+
 #endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
include/linux/cdrom.h +86 -141

277 lines not on this page · raw message

include/linux/ide.h +73 -156

289 lines not on this page · raw message