From: Dominic Sacré Date: Tue, 4 Nov 2014 23:30:18 +0000 (+0100) Subject: tools/env: Fix environment size and CRC on 64-bit hosts X-Git-Tag: v2015.01-rc1~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea19527c209b0d97b532a8dc5bf28f2cdd016888;p=platform%2Fkernel%2Fu-boot.git 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é Cc: Wolfgang Denk Cc: Tom Rini --- diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 30d5b03..1173eea 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -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);