diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-28 09:56:23 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-28 13:49:16 +0200 |
commit | 51885a7d7321c3e6395c36bc4fe8dde7e78cf562 (patch) | |
tree | c656f1c1e2571181aed4870aaa2e63861120d783 /drivers/ata | |
parent | a6e358b2f5b219fda18a7bc9348cb969043c19d5 (diff) | |
download | barebox-51885a7d7321c3e6395c36bc4fe8dde7e78cf562.tar.gz barebox-51885a7d7321c3e6395c36bc4fe8dde7e78cf562.tar.xz |
Change byte order detection mechanism to kernel style
The Linux Kernel defines only one of __LITTLE_ENDIAN and
__BIG_ENDIAN. Endianess can then be tested with #ifdef __xx_ENDIAN. Userspace
always defined both __LITTLE_ENDIAN and __BIG_ENDIAN and byteorder can then
be tested with #if __BYTE_ORDER == __xx_ENDIAN.
As we tend to use a lot of Kernel code in barebox we switch to use the kernel
way of determing the byte order.
As this always causes a lot of confusion add a check to include/common.h to
make sure only one of __LITTLE_ENDIAN and __BIG_ENDIAN is defined.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/disk_ata_drive.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c index 4602af3c0d..d5c583790c 100644 --- a/drivers/ata/disk_ata_drive.c +++ b/drivers/ata/disk_ata_drive.c @@ -231,7 +231,7 @@ static void __maybe_unused ata_dump_id(uint16_t *id) */ static void ata_fix_endianess(uint16_t *buf, unsigned wds) { -#if __BYTE_ORDER == __BIG_ENDIAN +#ifdef __BIG_ENDIAN unsigned u; for (u = 0; u < wds; u++) |