Skip to contentSkip to conversation

fix building when saveenv is disabled in some setups

PATCH New Mike Frysinger 2 participants 3 messages May 2, 2008 – May 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix building when saveenv is disabled in some setups

If you enable environment in the flash, but disable the embedded option, and you disable the saveenv command, then the #if nested logic will trigger a compile failure:
env_flash.c: In function ?env_relocate_spec?:
env_flash.c:399: error: ?flash_addr? undeclared (first use in this function) The fix is to add CMD_SAVEENV ifdef protection like everywhere else.

---
 common/env_flash.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
common/env_flash.c +2 -0
index eccfb62..a92160d 100644
@@ -378,7 +378,9 @@ void env_relocate_spec (void)
 		puts ("*** Warning - some problems detected "
 		      "reading environment; recovered successfully\n\n");
 #endif /* CFG_ENV_ADDR_REDUND */
+#ifdef CMD_SAVEENV
 	memcpy (env_ptr, (void*)flash_addr, CFG_ENV_SIZE);
+#endif
 #endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */
 }
 
Signature · 1 line
1.5.5.1
#1 lore raw

PATCH 1/1 fix building when saveenv is disabled in some setups

Quoted 18 lines · In message <[email protected]> you wrote:

SWYgeW91IGVuYWJsZSBlbnZpcm9ubWVudCBpbiB0aGUgZmxhc2gsIGJ1dCBkaXNhYmxlIHRoZSBl bWJlZGRlZCBvcHRpb24sCmFuZCB5b3UgZGlzYWJsZSB0aGUgc2F2ZWVudiBjb21tYW5kLCB0aGVu IHRoZSAjaWYgbmVzdGVkIGxvZ2ljIHdpbGwgdHJpZ2dlcgphIGNvbXBpbGUgZmFpbHVyZToKZW52 X2ZsYXNoLmM6IEluIGZ1bmN0aW9uIOKAmGVudl9yZWxvY2F0ZV9zcGVj4oCZOgplbnZfZmxhc2gu YzozOTk6IGVycm9yOiDigJhmbGFzaF9hZGRy4oCZIHVuZGVjbGFyZWQgKGZpcnN0IHVzZSBpbiB0 aGlzIGZ1bmN0aW9uKQpUaGUgZml4IGlzIHRvIGFkZCBDTURfU0FW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JlbmNlIApEb24ndCBtaXNzIHRo aXMgeWVhcidzIGV4Y2l0aW5nIGV2ZW50LiBUaGVyZSdzIHN0aWxsIHRpbWUgdG8gc2F2ZSAkMTAw LiAKVXNlIHByaW9yaXR5IGNvZGUgSjhUTDJEMi4gCmh0dHA6Ly9hZC5kb3VibGVjbGljay5uZXQv Y2xrOzE5ODc1NzY3MzsxMzUwMzAzODtwP2h0dHA6Ly9qYXZhLnN1bi5jb20vamF2YW9uZQpfX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpVLUJvb3QtVXNlcnMg bWFpbGluZyBsaXN0ClUtQm9vdC1Vc2Vyc0BsaXN0cy5zb3VyY2Vmb3JnZS5uZXQKaHR0cHM6Ly9s aXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vdS1ib290LXVzZXJzCg==

Please do not send base 64 encoded messages.

Please send plain text only.

Quoted 8 lines

If you enable environment in the flash, but disable the embedded option, and you disable the saveenv command, then the #if nested logic will trigger a compile failure:
env_flash.c: In function `env_relocate_spec':
env_flash.c:399: error: `flash_addr' undeclared (first use in this function)
The fix is to add CMD_SAVEENV ifdef protection like everywhere else.

Quoted 4 lines
---
 common/env_flash.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Children are natural mimics who act like their parents despite  every
effort to teach them good manners.
#2 lore raw

PATCH 1/1 fix building when saveenv is disabled in some setups

Quoted 7 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:

SWYgeW91IGVuYWJsZSBlbnZpcm9ubWVudCBpbiB0aGUgZmxhc2gsIGJ1dCBkaXNhYmxlIHRoZ bWFpbGluZyBsaXN0ClUtQm9vdC1Vc2Vyc0BsaXN0cy5zb3VyY2Vmb3JnZS5uZXQKaHR0cHM6L

Please do not send base 64 encoded messages.

Please send plain text only.

complain to git. i just used git-send-email.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080504/ef0b3819/attachment.pgp