diff mbox

[U-Boot] tools/env: Fix environment size and CRC on 64-bit hosts

Message ID 1415143818-16306-1-git-send-email-dominic.sacre@gmx.de
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Dominic Sacré Nov. 4, 2014, 11:30 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Nov. 10, 2014, 9:27 p.m. UTC | #1
On Wed, Nov 05, 2014 at 12:30:18AM +0100, Dominic Sacré wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox

Patch

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