Commit ea19527c209b0d97b532a8dc5bf28f2cdd016888

Authored by Dominic Sacré
Committed by Tom Rini
1 parent c4c2e14102

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: Dominic Sacré <dominic.sacre@gmx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -125,7 +125,7 @@
125 125 #endif
126 126 static inline ulong getenvsize (void)
127 127 {
128   - ulong rc = CUR_ENVSIZE - sizeof(long);
  128 + ulong rc = CUR_ENVSIZE - sizeof(uint32_t);
129 129  
130 130 if (HaveRedundEnv)
131 131 rc -= sizeof (char);