[U-Boot] [PATCH] usb.h: use standard __LITTLE_ENDIAN from Linux headers

Mike Frysinger vapier at gentoo.org
Thu Jan 1 09:00:56 CET 2009


Rather than forcing people to define a custom "LITTLEENDIAN", just use the
__LITTLE_ENDIAN one from the Linux byteorder headers that every arch is
already setting up.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 common/usb_storage.c |    2 --
 include/usb.h        |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/common/usb_storage.c b/common/usb_storage.c
index 94f659f..bb468aa 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -45,8 +45,6 @@
  * New Note:
  * Support for USB Mass Storage Devices (BBB) has been added. It has
  * only been tested with USB memory sticks.
- * Nota bene: if you are using the BBB support with a little-endian
- * CPU then you MUST define LITTLEENDIAN in the configuration file!
  */
 
 
diff --git a/include/usb.h b/include/usb.h
index 510df95..e7ede32 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -263,13 +263,13 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
 		((x_ & 0xFF000000UL) >> 24)); \
 	})
 
-#ifdef LITTLEENDIAN
+#if __LITTLE_ENDIAN
 # define swap_16(x) (x)
 # define swap_32(x) (x)
 #else
 # define swap_16(x) __swap_16(x)
 # define swap_32(x) __swap_32(x)
-#endif /* LITTLEENDIAN */
+#endif
 
 /*
  * Calling this entity a "pipe" is glorifying it. A USB pipe
-- 
1.6.0.6



More information about the U-Boot mailing list