Commit 2c61f14c60ccc5a1c90205991bf555872887a831

Authored by Wolfgang Denk
1 parent 452f67407b

Fix compile problem in cmd_flash.c

Patch by Teun Grinwis, 05 Aug 2005

Showing 1 changed file with 5 additions and 3 deletions Side-by-side Diff

... ... @@ -116,12 +116,13 @@
116 116 static int
117 117 addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
118 118 {
  119 + char len_used = 0; /* indicates if the "start +length" form used */
119 120 char *ep;
  121 +
120 122 *addr_first = simple_strtoul(arg1, &ep, 16);
121 123 if (ep == arg1 || *ep != '\0')
122 124 return -1;
123 125  
124   - char len_used = 0; /* indicates if the "start +length" form used */
125 126 if (arg2 && *arg2 == '+'){
126 127 len_used = 1;
127 128 ++arg2;
... ... @@ -132,6 +133,9 @@
132 133 return -1;
133 134  
134 135 if (len_used){
  136 + char found = 0;
  137 + ulong bank;
  138 +
135 139 /*
136 140 * *addr_last has the length, compute correct *addr_last
137 141 * XXX watch out for the integer overflow! Right now it is
... ... @@ -146,8 +150,6 @@
146 150 */
147 151  
148 152 /* find the end addr of the sector where the *addr_last is */
149   - char found = 0;
150   - ulong bank;
151 153 for (bank = 0; bank < CFG_MAX_FLASH_BANKS && !found; ++bank){
152 154 int i;
153 155 flash_info_t *info = &flash_info[bank];