aboutsummaryrefslogtreecommitdiff
path: root/common/env_nand.c
diff options
context:
space:
mode:
authorMarkus Klotzbuecher <mk@denx.de>2006-03-24 15:43:16 +0100
committerMarkus Klotzbcher <mk@pollux.denx.de>2006-03-24 15:43:16 +0100
commit2770bcb21c82835a5351176e5b2a9221d7fc8ef9 (patch)
tree78edf9afc584e1a76d219bd64d260224a84f0d10 /common/env_nand.c
parent0b953ffc653fc5ab3d3fa47abf0dd9b8bd0703f5 (diff)
parent05d8dce9d07cf4073ea15fbc448c1ce22b6baf0f (diff)
downloadu-boot-linaro-natty-2770bcb21c82835a5351176e5b2a9221d7fc8ef9.tar.gz
Merge with http://www.denx.de/git/u-boot.git
Diffstat (limited to 'common/env_nand.c')
-rw-r--r--common/env_nand.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/common/env_nand.c b/common/env_nand.c
index 2e1bfa666..a6af74a75 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -111,7 +111,8 @@ int env_init(void)
#ifdef CFG_ENV_OFFSET_REDUND
int saveenv(void)
{
- int total, ret = 0;
+ ulong total;
+ int ret = 0;
DECLARE_GLOBAL_DATA_PTR;
@@ -146,7 +147,8 @@ int saveenv(void)
#else /* ! CFG_ENV_OFFSET_REDUND */
int saveenv(void)
{
- int total, ret = 0;
+ ulong total;
+ int ret = 0;
puts ("Erasing Nand...");
if (nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_SIZE))
@@ -154,8 +156,7 @@ int saveenv(void)
puts ("Writing to Nand... ");
total = CFG_ENV_SIZE;
- ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total,
- (u_char*) env_ptr);
+ ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr);
if (ret || total != CFG_ENV_SIZE)
return 1;
@@ -169,7 +170,8 @@ int saveenv(void)
void env_relocate_spec (void)
{
#if !defined(ENV_IS_EMBEDDED)
- int crc1_ok = 0, crc2_ok = 0, total;
+ ulong total;
+ int crc1_ok = 0, crc2_ok = 0;
env_t *tmp_env1, *tmp_env2;
DECLARE_GLOBAL_DATA_PTR;
@@ -227,12 +229,12 @@ void env_relocate_spec (void)
void env_relocate_spec (void)
{
#if !defined(ENV_IS_EMBEDDED)
- int ret, total;
+ ulong total;
+ int ret;
total = CFG_ENV_SIZE;
- ret = nand_read(&nand_info[0], CFG_ENV_OFFSET, &total,
- (u_char*) env_ptr);
- if (ret || total != CFG_ENV_SIZE)
+ ret = nand_read(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr);
+ if (ret || total != CFG_ENV_SIZE)
return use_default();
if (crc32(0, env_ptr->data, ENV_SIZE) != env_ptr->crc)