summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2023-03-04 00:21:30 +0800
committerJes Sorensen <jes@trained-monkey.org>2023-03-08 13:54:30 -0500
commita0151041642dffff2421c22e18fb7b02b58787d9 (patch)
treef5100c6553ab040395d8f76a1a97e6a3dd069309
parent0a07dea8d3b78a22a59f4604a5e8da15690f28e3 (diff)
downloadmdadm-a0151041642dffff2421c22e18fb7b02b58787d9.tar.gz
util.c: reorder code lines in parse_layout_faulty()
Resort the code lines in parse_layout_faulty() to make it more comfortable, no logic change. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
-rw-r--r--util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/util.c b/util.c
index 7fc881b..b0b7aec 100644
--- a/util.c
+++ b/util.c
@@ -421,12 +421,15 @@ int parse_layout_10(char *layout)
int parse_layout_faulty(char *layout)
{
+ int ln, mode;
+ char *m;
+
if (!layout)
return -1;
+
/* Parse the layout string for 'faulty' */
- int ln = strcspn(layout, "0123456789");
- char *m = xstrdup(layout);
- int mode;
+ ln = strcspn(layout, "0123456789");
+ m = xstrdup(layout);
m[ln] = 0;
mode = map_name(faultylayout, m);
if (mode == UnSet)