diff options
author | Jeff Angielski <jeff@theptrgroup.com> | 2010-03-17 15:09:26 -0400 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-03-21 22:22:53 +0100 |
commit | 322ff395c9aec7b87a2211fe4333fdf44377c564 (patch) | |
tree | 00a4add6c70ec0dbc26a1c425d3da3c527ee7150 | |
parent | 51c2ac9bb574c1420b993615268392b0c1f829f6 (diff) | |
download | bootable_bootloader_goldelico_gta04-322ff395c9aec7b87a2211fe4333fdf44377c564.zip bootable_bootloader_goldelico_gta04-322ff395c9aec7b87a2211fe4333fdf44377c564.tar.gz bootable_bootloader_goldelico_gta04-322ff395c9aec7b87a2211fe4333fdf44377c564.tar.bz2 |
env: fix endian ordering in crc table
The crc table was being built as little endian for big endian
targets. This would cause fw_printenv to always fail with
"Warning: Bad CRC, using default environment" messages.
Signed-off-by: Jeff Angielski <jeff@theptrgroup.com>
Acked-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
-rw-r--r-- | lib_generic/crc32.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib_generic/crc32.c b/lib_generic/crc32.c index 468b397..27335a3 100644 --- a/lib_generic/crc32.c +++ b/lib_generic/crc32.c @@ -163,7 +163,7 @@ const uint32_t * ZEXPORT get_crc_table() #endif /* ========================================================================= */ -# ifdef __LITTLE_ENDIAN +# if __BYTE_ORDER == __LITTLE_ENDIAN # define DO_CRC(x) crc = tab[(crc ^ (x)) & 255] ^ (crc >> 8) # else # define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc << 8) |