This commit doesn't change any codes, just tidy up the
code formatting.
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
char devnm[32];
int in_devs = 0;
char devnm[32];
int in_devs = 0;
- if (strcmp(line, "Personalities")==0)
+ if (strcmp(line, "Personalities") == 0)
- if (strcmp(line, "read_ahead")==0)
+ if (strcmp(line, "read_ahead") == 0)
- if (strcmp(line, "unused")==0)
+ if (strcmp(line, "unused") == 0)
continue;
insert_here = NULL;
/* Better be an md line.. */
continue;
insert_here = NULL;
/* Better be an md line.. */
for (w=dl_next(line); w!= line ; w=dl_next(w)) {
int l = strlen(w);
char *eq;
for (w=dl_next(line); w!= line ; w=dl_next(w)) {
int l = strlen(w);
char *eq;
- if (strcmp(w, "active")==0)
+ if (strcmp(w, "active") == 0)
- else if (strcmp(w, "inactive")==0) {
+ else if (strcmp(w, "inactive") == 0) {
ent->active = 0;
in_devs = 1;
} else if (ent->active > 0 &&
ent->active = 0;
in_devs = 1;
} else if (ent->active > 0 &&
w[0] != '(' /*readonly*/) {
ent->level = xstrdup(w);
in_devs = 1;
w[0] != '(' /*readonly*/) {
ent->level = xstrdup(w);
in_devs = 1;
- } else if (in_devs && strcmp(w, "blocks")==0)
+ } else if (in_devs && strcmp(w, "blocks") == 0)
in_devs = 0;
else if (in_devs) {
char *ep = strchr(w, '[');
ent->devcnt +=
add_member_devname(&ent->members, w);
in_devs = 0;
else if (in_devs) {
char *ep = strchr(w, '[');
ent->devcnt +=
add_member_devname(&ent->members, w);
- if (ep && strncmp(w, "md", 2)==0) {
+ if (ep && strncmp(w, "md", 2) == 0) {
/* This has an md device as a component.
* If that device is already in the
* list, make sure we insert before
/* This has an md device as a component.
* If that device is already in the
* list, make sure we insert before
} else if (w[0] == '[' && isdigit(w[1])) {
ent->raid_disks = atoi(w+1);
} else if (!ent->pattern &&
} else if (w[0] == '[' && isdigit(w[1])) {
ent->raid_disks = atoi(w+1);
} else if (!ent->pattern &&
- w[0] == '[' &&
- (w[1] == 'U' || w[1] == '_')) {
+ w[0] == '[' &&
+ (w[1] == 'U' || w[1] == '_')) {
ent->pattern = xstrdup(w+1);
ent->pattern = xstrdup(w+1);
- if (ent->pattern[l-2]==']')
+ if (ent->pattern[l-2] == ']')
ent->pattern[l-2] = '\0';
} else if (ent->percent == RESYNC_NONE &&
ent->pattern[l-2] = '\0';
} else if (ent->percent == RESYNC_NONE &&
- strncmp(w, "re", 2)== 0 &&
+ strncmp(w, "re", 2) == 0 &&
- (eq=strchr(w, '=')) != NULL ) {
+ (eq = strchr(w, '=')) != NULL ) {
ent->percent = atoi(eq+1);
ent->percent = atoi(eq+1);
- if (strncmp(w,"resync", 6)==0)
+ if (strncmp(w,"resync", 6) == 0)
- else if (strncmp(w, "reshape", 7)==0)
+ else if (strncmp(w, "reshape", 7) == 0)
ent->resync = 2;
else
ent->resync = 0;
} else if (ent->percent == RESYNC_NONE &&
(w[0] == 'r' || w[0] == 'c')) {
ent->resync = 2;
else
ent->resync = 0;
} else if (ent->percent == RESYNC_NONE &&
(w[0] == 'r' || w[0] == 'c')) {
- if (strncmp(w, "resync", 4)==0)
+ if (strncmp(w, "resync", 4) == 0)
- if (strncmp(w, "reshape", 7)==0)
+ if (strncmp(w, "reshape", 7) == 0)
- if (strncmp(w, "recovery", 8)==0)
+ if (strncmp(w, "recovery", 8) == 0)
- if (strncmp(w, "check", 5)==0)
+ if (strncmp(w, "check", 5) == 0)
ent->resync = 3;
if (l > 8 && strcmp(w+l-8, "=DELAYED") == 0)
ent->resync = 3;
if (l > 8 && strcmp(w+l-8, "=DELAYED") == 0)