]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
util.c: reorder code lines in parse_layout_faulty()
authorColy Li <colyli@suse.de>
Fri, 3 Mar 2023 16:21:30 +0000 (00:21 +0800)
committerJes Sorensen <jes@trained-monkey.org>
Wed, 8 Mar 2023 18:54:30 +0000 (13:54 -0500)
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>
util.c

diff --git a/util.c b/util.c
index 7fc881bfad3f1b69715d58e6a7b216cfbde8e59d..b0b7aec4e0d4d419887b4500549eaa634034bc78 100644 (file)
--- 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)