summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-04-16 10:27:31 +0200
committerWolfgang Denk <wd@pollux.denx.de>2006-04-16 10:27:31 +0200
commit807522fc9ae49e022c9f3556506b4f4c961b17aa (patch)
tree2f490b01ed00c70cb2eec4a89667cbb9da1ef5a2 /common
parentb81a4630a3914d611ca3e72b451c4509c60ae9b1 (diff)
parentad88297e2f14220f34417d1304d256285887aed4 (diff)
downloadu-boot-imx-807522fc9ae49e022c9f3556506b4f4c961b17aa.zip
u-boot-imx-807522fc9ae49e022c9f3556506b4f4c961b17aa.tar.gz
u-boot-imx-807522fc9ae49e022c9f3556506b4f4c961b17aa.tar.bz2
Merge with /home/hs/U-Boot/u-boot-dev
Diffstat (limited to 'common')
-rw-r--r--common/cmd_flash.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 201f4e3..cb1c5bb 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -125,13 +125,16 @@ abbrev_spec (char *str, flash_info_t ** pinfo, int *psf, int *psl)
static int
addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
{
- char len_used = 0; /* indicates if the "start +length" form used */
char *ep;
+ char len_used; /* indicates if the "start +length" form used */
+ char found;
+ ulong bank;
*addr_first = simple_strtoul(arg1, &ep, 16);
if (ep == arg1 || *ep != '\0')
return -1;
+ len_used = 0;
if (arg2 && *arg2 == '+'){
len_used = 1;
++arg2;
@@ -142,9 +145,6 @@ addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
return -1;
if (len_used){
- char found = 0;
- ulong bank;
-
/*
* *addr_last has the length, compute correct *addr_last
* XXX watch out for the integer overflow! Right now it is
@@ -159,6 +159,7 @@ addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
*/
/* find the end addr of the sector where the *addr_last is */
+ found = 0;
for (bank = 0; bank < CFG_MAX_FLASH_BANKS && !found; ++bank){
int i;
flash_info_t *info = &flash_info[bank];
@@ -506,12 +507,10 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
info->protect[i] = p;
#endif /* CFG_FLASH_PROTECTION */
}
- }
-
#if defined(CFG_FLASH_PROTECTION)
- if (!rcode) puts (" done\n");
+ if (!rcode) puts (" done\n");
#endif /* CFG_FLASH_PROTECTION */
-
+ }
return rcode;
}