]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
env: fix endian ordering in crc table
authorJeff Angielski <jeff@theptrgroup.com>
Wed, 17 Mar 2010 19:09:26 +0000 (15:09 -0400)
committerWolfgang Denk <wd@denx.de>
Sun, 21 Mar 2010 21:22:53 +0000 (22:22 +0100)
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>
lib_generic/crc32.c

index 468b3979ab1ffa9f9f87891147c932e3fb0fb61f..27335a3ed9095b19d533c33a742fd752935d4640 100644 (file)
@@ -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)