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@xxxxxxx> --- mdmon.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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)