dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-Fixup-a-number-of-whitespace-inconsistency-cas.patch

2c1b57
From 8ea982179af73f5b1d3fc937676ec7c969a190ac Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <Jes.Sorensen@gmail.com>
2c1b57
Date: Wed, 29 Mar 2017 12:02:14 -0400
2c1b57
Subject: [RHEL7.5 PATCH 034/169] mdadm: Fixup a number of whitespace
2c1b57
 inconsistency cases
2c1b57
2c1b57
Lots of code lacked whitespaces in assignments, and in other places
2c1b57
had them in the wrong place.
2c1b57
2c1b57
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
2c1b57
---
2c1b57
 mdadm.c | 51 +++++++++++++++++++++++++--------------------------
2c1b57
 1 file changed, 25 insertions(+), 26 deletions(-)
2c1b57
2c1b57
diff --git a/mdadm.c b/mdadm.c
2c1b57
index 502e721..0f32773 100644
2c1b57
--- a/mdadm.c
2c1b57
+++ b/mdadm.c
2c1b57
@@ -106,11 +106,11 @@ int main(int argc, char *argv[])
2c1b57
 
2c1b57
 	srandom(time(0) ^ getpid());
2c1b57
 
2c1b57
-	ident.uuid_set=0;
2c1b57
+	ident.uuid_set = 0;
2c1b57
 	ident.level = UnSet;
2c1b57
 	ident.raid_disks = UnSet;
2c1b57
-	ident.super_minor= UnSet;
2c1b57
-	ident.devices=0;
2c1b57
+	ident.super_minor = UnSet;
2c1b57
+	ident.devices = 0;
2c1b57
 	ident.spare_group = NULL;
2c1b57
 	ident.autof = 0;
2c1b57
 	ident.st = NULL;
2c1b57
@@ -120,10 +120,9 @@ int main(int argc, char *argv[])
2c1b57
 	ident.container = NULL;
2c1b57
 	ident.member = NULL;
2c1b57
 
2c1b57
-	while ((option_index = -1) ,
2c1b57
-	       (opt=getopt_long(argc, argv,
2c1b57
-				shortopt, long_options,
2c1b57
-				&option_index)) != -1) {
2c1b57
+	while ((option_index = -1),
2c1b57
+	       (opt = getopt_long(argc, argv, shortopt, long_options,
2c1b57
+				  &option_index)) != -1) {
2c1b57
 		int newmode = mode;
2c1b57
 		/* firstly, some mode-independent options */
2c1b57
 		switch(opt) {
2c1b57
@@ -397,7 +396,7 @@ int main(int argc, char *argv[])
2c1b57
 				pr_err("metadata information already given\n");
2c1b57
 				exit(2);
2c1b57
 			}
2c1b57
-			for(i=0; !ss && superlist[i]; i++)
2c1b57
+			for(i = 0; !ss && superlist[i]; i++)
2c1b57
 				ss = superlist[i]->match_metadata_desc(optarg);
2c1b57
 
2c1b57
 			if (!ss) {
2c1b57
@@ -542,7 +541,7 @@ int main(int argc, char *argv[])
2c1b57
 
2c1b57
 			case 5:
2c1b57
 				s.layout = map_name(r5layout, optarg);
2c1b57
-				if (s.layout==UnSet) {
2c1b57
+				if (s.layout == UnSet) {
2c1b57
 					pr_err("layout %s not understood for raid5.\n",
2c1b57
 						optarg);
2c1b57
 					exit(2);
2c1b57
@@ -550,7 +549,7 @@ int main(int argc, char *argv[])
2c1b57
 				break;
2c1b57
 			case 6:
2c1b57
 				s.layout = map_name(r6layout, optarg);
2c1b57
-				if (s.layout==UnSet) {
2c1b57
+				if (s.layout == UnSet) {
2c1b57
 					pr_err("layout %s not understood for raid6.\n",
2c1b57
 						optarg);
2c1b57
 					exit(2);
2c1b57
@@ -665,7 +664,7 @@ int main(int argc, char *argv[])
2c1b57
 		case O(MISC,'f'): /* force zero */
2c1b57
 		case O(MISC,Force): /* force zero */
2c1b57
 		case O(MANAGE,Force): /* add device which is too large */
2c1b57
-			c.force=1;
2c1b57
+			c.force = 1;
2c1b57
 			continue;
2c1b57
 			/* now for the Assemble options */
2c1b57
 		case O(ASSEMBLE, FreezeReshape):   /* Freeze reshape during
2c1b57
@@ -777,12 +776,12 @@ int main(int argc, char *argv[])
2c1b57
 				continue;
2c1b57
 			if (strcmp(c.update, "revert-reshape") == 0)
2c1b57
 				continue;
2c1b57
-			if (strcmp(c.update, "byteorder")==0) {
2c1b57
+			if (strcmp(c.update, "byteorder") == 0) {
2c1b57
 				if (ss) {
2c1b57
 					pr_err("must not set metadata type with --update=byteorder.\n");
2c1b57
 					exit(2);
2c1b57
 				}
2c1b57
-				for(i=0; !ss && superlist[i]; i++)
2c1b57
+				for(i = 0; !ss && superlist[i]; i++)
2c1b57
 					ss = superlist[i]->match_metadata_desc(
2c1b57
 						"0.swap");
2c1b57
 				if (!ss) {
2c1b57
@@ -1476,7 +1475,7 @@ int main(int argc, char *argv[])
2c1b57
 				pr_err("can only assemble a single array when providing a backup file.\n");
2c1b57
 				exit(1);
2c1b57
 			}
2c1b57
-			for (dv = devlist ; dv ; dv=dv->next) {
2c1b57
+			for (dv = devlist; dv; dv = dv->next) {
2c1b57
 				struct mddev_ident *array_ident = conf_get_ident(dv->devname);
2c1b57
 				if (array_ident == NULL) {
2c1b57
 					pr_err("%s not identified in config file.\n",
2c1b57
@@ -1611,10 +1610,10 @@ int main(int argc, char *argv[])
2c1b57
 			else
2c1b57
 				c.delay = 60;
2c1b57
 		}
2c1b57
-		rv= Monitor(devlist, mailaddr, program,
2c1b57
-			    &c, daemonise, oneshot,
2c1b57
-			    dosyslog, pidfile, increments,
2c1b57
-			    spare_sharing);
2c1b57
+		rv = Monitor(devlist, mailaddr, program,
2c1b57
+			     &c, daemonise, oneshot,
2c1b57
+			     dosyslog, pidfile, increments,
2c1b57
+			     spare_sharing);
2c1b57
 		break;
2c1b57
 
2c1b57
 	case GROW:
2c1b57
@@ -1654,7 +1653,7 @@ int main(int argc, char *argv[])
2c1b57
 				rv = 1;
2c1b57
 				break;
2c1b57
 			}
2c1b57
-			for (dv=devlist->next; dv ; dv=dv->next) {
2c1b57
+			for (dv = devlist->next; dv; dv = dv->next) {
2c1b57
 				rv = Grow_Add_device(devlist->devname, mdfd,
2c1b57
 						     dv->devname);
2c1b57
 				if (rv)
2c1b57
@@ -1749,7 +1748,7 @@ static int scan_assemble(struct supertype *ss,
2c1b57
 		pr_err("No devices listed in conf file were found.\n");
2c1b57
 		return 1;
2c1b57
 	}
2c1b57
-	for (a = array_list; a ; a = a->next) {
2c1b57
+	for (a = array_list; a; a = a->next) {
2c1b57
 		a->assembled = 0;
2c1b57
 		if (a->autof == 0)
2c1b57
 			a->autof = c->autof;
2c1b57
@@ -1760,7 +1759,7 @@ static int scan_assemble(struct supertype *ss,
2c1b57
 		failures = 0;
2c1b57
 		successes = 0;
2c1b57
 		rv = 0;
2c1b57
-		for (a = array_list; a ; a = a->next) {
2c1b57
+		for (a = array_list; a; a = a->next) {
2c1b57
 			int r;
2c1b57
 			if (a->assembled)
2c1b57
 				continue;
2c1b57
@@ -1826,7 +1825,7 @@ static int misc_scan(char devmode, struct context *c)
2c1b57
 	int rv = 0;
2c1b57
 
2c1b57
 	for (members = 0; members <= 1; members++) {
2c1b57
-		for (e=ms ; e ; e=e->next) {
2c1b57
+		for (e = ms; e; e = e->next) {
2c1b57
 			char *name = NULL;
2c1b57
 			struct map_ent *me;
2c1b57
 			struct stat stb;
2c1b57
@@ -1864,7 +1863,7 @@ static int stop_scan(int verbose)
2c1b57
 	/* Due to possible stacking of devices, repeat until
2c1b57
 	 * nothing more can be stopped
2c1b57
 	 */
2c1b57
-	int progress=1, err;
2c1b57
+	int progress = 1, err;
2c1b57
 	int last = 0;
2c1b57
 	int rv = 0;
2c1b57
 	do {
2c1b57
@@ -1873,7 +1872,7 @@ static int stop_scan(int verbose)
2c1b57
 
2c1b57
 		if (!progress) last = 1;
2c1b57
 		progress = 0; err = 0;
2c1b57
-		for (e=ms ; e ; e=e->next) {
2c1b57
+		for (e = ms; e; e = e->next) {
2c1b57
 			char *name = get_md_name(e->devnm);
2c1b57
 			int mdfd;
2c1b57
 
2c1b57
@@ -1908,7 +1907,7 @@ static int misc_list(struct mddev_dev *devlist,
2c1b57
 	struct mddev_dev *dv;
2c1b57
 	int rv = 0;
2c1b57
 
2c1b57
-	for (dv=devlist ; dv; dv=(rv & 16) ? NULL : dv->next) {
2c1b57
+	for (dv = devlist; dv; dv = (rv & 16) ? NULL : dv->next) {
2c1b57
 		int mdfd;
2c1b57
 
2c1b57
 		switch(dv->disposition) {
2c1b57
@@ -1974,7 +1973,7 @@ static int misc_list(struct mddev_dev *devlist,
2c1b57
 			case 1:
2c1b57
 				mdfd = open_mddev(dv->devname, 1);  
2c1b57
 		}
2c1b57
-		if (mdfd>=0) {
2c1b57
+		if (mdfd >= 0) {
2c1b57
 			switch(dv->disposition) {
2c1b57
 			case 'R':
2c1b57
 				c->runstop = 1;
2c1b57
-- 
2c1b57
2.7.4
2c1b57