]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
ddf: use correct loop variable in activate_spare
authorNeilBrown <neilb@suse.de>
Tue, 15 Mar 2011 03:54:46 +0000 (14:54 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 15 Mar 2011 03:54:46 +0000 (14:54 +1100)
Using 'i' when you mean 'j' just shows how silly it is to use
variables named 'i' and 'j'.

Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c

index 96d75ea82a031d423e6fe490af119e0abb93a770..90133195d17f0e07ddb201a11f0c7c113c92364a 100644 (file)
@@ -3619,13 +3619,14 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a,
                                esize = ex[j].start - pos;
                                if (esize >= a->info.component_size)
                                        break;
-                               pos = ex[i].start + ex[i].size;
-                               i++;
-                       } while (ex[i-1].size);
+                               pos = ex[j].start + ex[j].size;
+                               j++;
+                       } while (ex[j-1].size);
 
                        free(ex);
                        if (esize < a->info.component_size) {
-                               dprintf("%x:%x has no room: %llu %llu\n", dl->major, dl->minor,
+                               dprintf("%x:%x has no room: %llu %llu\n",
+                                       dl->major, dl->minor,
                                        esize, a->info.component_size);
                                /* No room */
                                continue;