summaryrefslogtreecommitdiff
path: root/common/cmd_flash.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-05 11:10:31 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-05 11:10:31 +0200
commit2c61f14c60ccc5a1c90205991bf555872887a831 (patch)
treec719ff74de97f3e1ebf27ee4699eae177e4823b0 /common/cmd_flash.c
parent452f67407b20ab6a37c037d0975ea717d2f254e9 (diff)
downloadu-boot-imx-2c61f14c60ccc5a1c90205991bf555872887a831.zip
u-boot-imx-2c61f14c60ccc5a1c90205991bf555872887a831.tar.gz
u-boot-imx-2c61f14c60ccc5a1c90205991bf555872887a831.tar.bz2
Fix compile problem in cmd_flash.c
Patch by Teun Grinwis, 05 Aug 2005
Diffstat (limited to 'common/cmd_flash.c')
-rw-r--r--common/cmd_flash.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 162d1ff..3972082 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -116,12 +116,13 @@ 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;
+
*addr_first = simple_strtoul(arg1, &ep, 16);
if (ep == arg1 || *ep != '\0')
return -1;
- char len_used = 0; /* indicates if the "start +length" form used */
if (arg2 && *arg2 == '+'){
len_used = 1;
++arg2;
@@ -132,6 +133,9 @@ 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
@@ -146,8 +150,6 @@ addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
*/
/* find the end addr of the sector where the *addr_last is */
- char found = 0;
- ulong bank;
for (bank = 0; bank < CFG_MAX_FLASH_BANKS && !found; ++bank){
int i;
flash_info_t *info = &flash_info[bank];