block: fix formatting & indent in the mount_device()
authorRafał Miłecki <rafal@milecki.pl>
Fri, 30 Nov 2018 13:09:20 +0000 (14:09 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Tue, 4 Dec 2018 08:15:26 +0000 (09:15 +0100)
There was some misformatted code that seemed like switch block having an
else block. This improves code readability.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Michael Heimpold <mhei@heimpold.de>
block.c

diff --git a/block.c b/block.c
index b01a63307a360b729c399186d3524a09a6574630..d87251ddfa46e74fb7ad60aed3d8a49569f60acc 100644 (file)
--- a/block.c
+++ b/block.c
@@ -1021,22 +1021,24 @@ static int mount_device(struct probe_info *pr, int type)
        if (m && m->extroot)
                return -1;
 
-       if (m) switch (type) {
-       case TYPE_HOTPLUG:
-               blockd_notify(device, m, pr);
-               if (m->autofs)
-                       return 0;
-               if (!auto_mount)
-                       return -1;
-               break;
-       case TYPE_AUTOFS:
-               if (!m->autofs)
-                       return -1;
-               break;
-       case TYPE_DEV:
-               if (m->autofs)
-                       return -1;
-               break;
+       if (m) {
+               switch (type) {
+               case TYPE_HOTPLUG:
+                       blockd_notify(device, m, pr);
+                       if (m->autofs)
+                               return 0;
+                       if (!auto_mount)
+                               return -1;
+                       break;
+               case TYPE_AUTOFS:
+                       if (!m->autofs)
+                               return -1;
+                       break;
+               case TYPE_DEV:
+                       if (m->autofs)
+                               return -1;
+                       break;
+               }
        } else if (type == TYPE_HOTPLUG) {
                blockd_notify(device, NULL, pr);
        }