From: Remy Bohmer Date: Thu, 1 Jan 2009 11:22:46 +0100 Subject: [U-Boot] [PATCH] usb.h: use standard __LITTLE_ENDIAN from Linux headers In-Reply-To: <1230796856-19298-1-git-send-email-vapier@gentoo.org> References: <1230796856-19298-1-git-send-email-vapier@gentoo.org> Message-ID: <3efb10970901010222o848504fs8e80ce8e9037a04c@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Mike, 2009/1/1 Mike Frysinger : > 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. > 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! > */ There are a few more C-files (*usb_ohci.c) that has this comment, please remove them all. Also clean up the config files that has this flag set. This flag seem to be set only for this reason. > > 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 I would prefer '#if defined(__LITTLE_ENDIAN)' Kind Regards, Remy > # 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 > >