mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-26 05:34:30 +08:00
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>
This commit is contained in:
parent
51c2ac9bb5
commit
322ff395c9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user