[U-Boot-Users] [PATCH] NAND: Fix warning due to missing env_ptr casts to u_char * in env_nand.c.

Marcel Ziswiler marcel at ziswiler.com
Sun Jun 22 16:13:46 CEST 2008


The writeenv() and readenv() calls introduced by the recently added bad block
management for environment variables were missing casts therefore producing
compile time warnings.
While at it fixing some typo in a comment and indentation.

Signed-off-by: Marcel Ziswiler <marcel at ziswiler.com>
---
 common/env_nand.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/env_nand.c b/common/env_nand.c
index e21d2a3..1fe874a 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -95,8 +95,8 @@ uchar env_get_char_spec (int index)
 /* this is called before nand_init()
  * so we can't read Nand to validate env data.
  * Mark it OK for now. env_relocate() in env_common.c
- * will call our relocate function which will does
- * the real validation.
+ * will call our relocate function which does the real
+ * validation.
  *
  * When using a NAND boot image (like sequoia_nand), the environment
  * can be embedded or attached to the U-Boot image in NAND flash. This way
@@ -231,7 +231,7 @@ int saveenv(void)
 	size_t total;
 	int ret = 0;
 	nand_erase_options_t nand_erase_options;
-	
+
 	nand_erase_options.length = CFG_ENV_RANGE;
 	nand_erase_options.quiet = 0;
 	nand_erase_options.jffs2 = 0;
@@ -246,7 +246,7 @@ int saveenv(void)
 
 	puts ("Writing to Nand... ");
 	total = CFG_ENV_SIZE;
-	if (writeenv(CFG_ENV_OFFSET, env_ptr)) {
+	if (writeenv(CFG_ENV_OFFSET, (u_char *) env_ptr)) {
 		puts("FAILED!\n");
 		return 1;
 	}
@@ -349,7 +349,7 @@ void env_relocate_spec (void)
 	int ret;
 
 	total = CFG_ENV_SIZE;
-	ret = readenv(CFG_ENV_OFFSET, env_ptr);
+	ret = readenv(CFG_ENV_OFFSET, (u_char *) env_ptr);
 	if (ret || total != CFG_ENV_SIZE)
 		return use_default();
 
-- 
1.5.4.1





More information about the U-Boot mailing list