浏览代码

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>
Dominic Sacré 9 年之前
父节点
当前提交
ea19527c20
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tools/env/fw_env.c

+ 1 - 1
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);