]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
tools/env: Fix environment size and CRC on 64-bit hosts
authorDominic Sacré <dominic.sacre@gmx.de>
Tue, 4 Nov 2014 23:30:18 +0000 (00:30 +0100)
committerTom Rini <trini@ti.com>
Fri, 7 Nov 2014 21:27:07 +0000 (16:27 -0500)
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>
tools/env/fw_env.c

index 30d5b037f09b21a252d15ca8fc447c570de43138..1173eea78206dca66942380f49df22aa5004ae48 100644 (file)
@@ -125,7 +125,7 @@ static int get_config (char *);
 #endif
 static inline ulong getenvsize (void)
 {
-       ulong rc = CUR_ENVSIZE - sizeof(long);
+       ulong rc = CUR_ENVSIZE - sizeof(uint32_t);
 
        if (HaveRedundEnv)
                rc -= sizeof (char);