diff mbox series

[3/6] mdmon: don't test both 'all' and 'container_name'.

Message ID 167745678752.16565.9787611444570379100.stgit@noble.brown (mailing list archive)
State Superseded, archived
Delegated to: Mariusz Tkaczyk
Headers show
Series Assorted patches relating to mdmon | expand

Commit Message

NeilBrown Feb. 27, 2023, 12:13 a.m. UTC
If 'all' is not set, then container_name must be NULL, as nothing else
can set it.  So simplify the test it ignore container_name.
This makes the purpose of the code more obvious.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 mdmon.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/mdmon.c b/mdmon.c
index f557e12c6533..6d37b17c3f53 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -358,7 +358,6 @@  int main(int argc, char *argv[])
 		}
 	}
 
-
 	if (in_initrd()) {
 		/*
 		 * set first char of argv[0] to @. This is used by
@@ -368,12 +367,10 @@  int main(int argc, char *argv[])
 		argv[0][0] = '@';
 	}
 
-	if (all == 0 && container_name == NULL) {
-		if (argv[optind]) {
-			container_name = get_md_name(argv[optind]);
-			if (!container_name)
-				return 1;
-		}
+	if (!all && argv[optind]) {
+		container_name = get_md_name(argv[optind]);
+		if (!container_name)
+			return 1;
 	}
 
 	if (container_name == NULL || argc - optind > 1)