Skip to content
Snippets Groups Projects
Commit ea19527c authored by Dominic Sacré's avatar Dominic Sacré Committed by Tom Rini
Browse files

tools/env: Fix environment size and CRC on 64-bit hosts


On architectures where 'long' is 64 bit, the u-boot environment
as seen by the fw_env tools was missing 4 bytes.
This patch fixes getenvsize(), and thus also ensures that the
environment's CRC32 checksum is calculated correctly.

Signed-off-by: default avatarDominic Sacré <dominic.sacre@gmx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
parent c4c2e141
No related branches found
No related tags found
No related merge requests found
...@@ -125,7 +125,7 @@ static int get_config (char *); ...@@ -125,7 +125,7 @@ static int get_config (char *);
#endif #endif
static inline ulong getenvsize (void) static inline ulong getenvsize (void)
{ {
ulong rc = CUR_ENVSIZE - sizeof(long); ulong rc = CUR_ENVSIZE - sizeof(uint32_t);
if (HaveRedundEnv) if (HaveRedundEnv)
rc -= sizeof (char); rc -= sizeof (char);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment