multipath-tools: indent switch and case at the same level
authorXose Vazquez Perez <xose.vazquez@gmail.com>
Wed, 3 Aug 2016 18:13:59 +0000 (20:13 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Tue, 9 Aug 2016 14:56:44 +0000 (16:56 +0200)
Found by checkpatch - ERROR: switch and case should be at the same indent

Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
kpartx/kpartx.c
libmpathpersist/mpath_pr_ioctl.c
libmultipath/prioritizers/alua.c
mpathpersist/main.c
multipathd/main.c

index b7b4047..d31fea8 100644 (file)
@@ -258,7 +258,8 @@ main(int argc, char **argv){
                exit(1);
        }
 
-       while ((arg = getopt(argc, argv, short_opts)) != EOF) switch(arg) {
+       while ((arg = getopt(argc, argv, short_opts)) != EOF)
+               switch(arg) {
                case 'r':
                        ro=1;
                        break;
@@ -295,7 +296,7 @@ main(int argc, char **argv){
                default:
                        usage();
                        exit(1);
-       }
+               }
 
 #ifdef LIBDM_API_COOKIE
        if (!udev_sync)
index 48d36e9..8b9ac3d 100644 (file)
@@ -272,22 +272,22 @@ decode_transport_id(struct prin_fulldescr *fdesc, unsigned char * p, int length)
                fdesc->trnptid.format_code = ((p[0] >> 6) & 0x3);
                fdesc->trnptid.protocol_id = (p[0] & 0xf);
                switch (fdesc->trnptid.protocol_id) {
-                       case MPATH_PROTOCOL_ID_FC:
-                               memcpy(&fdesc->trnptid.n_port_name, &p[8], 8);
-                               jump = 24;
-                               break;
-                       case MPATH_PROTOCOL_ID_ISCSI:
-                               num = ((p[2] << 8) | p[3]);
-                               memcpy(&fdesc->trnptid.iscsi_name, &p[4], num);
-                               jump = (((num + 4) < 24) ? 24 : num + 4);
-                               break;
-                       case MPATH_PROTOCOL_ID_SAS:
-                               memcpy(&fdesc->trnptid.sas_address, &p[4], 8);
-                               jump = 24;
-                               break;
-                       default:
-                               jump = 24;
-                               break;
+               case MPATH_PROTOCOL_ID_FC:
+                       memcpy(&fdesc->trnptid.n_port_name, &p[8], 8);
+                       jump = 24;
+                       break;
+               case MPATH_PROTOCOL_ID_ISCSI:
+                       num = ((p[2] << 8) | p[3]);
+                       memcpy(&fdesc->trnptid.iscsi_name, &p[4], num);
+                       jump = (((num + 4) < 24) ? 24 : num + 4);
+                       break;
+               case MPATH_PROTOCOL_ID_SAS:
+                       memcpy(&fdesc->trnptid.sas_address, &p[4], 8);
+                       jump = 24;
+                       break;
+               default:
+                       jump = 24;
+                       break;
                }
        }
 }
@@ -411,57 +411,57 @@ int mpath_translate_response (char * dev, struct sg_io_hdr io_hdr,
                return MPATH_PR_SUCCESS;
 
        switch(io_hdr.status) {
-               case SAM_STAT_GOOD:
-                       break;
-               case SAM_STAT_CHECK_CONDITION:
-                       condlog(2, "%s: Sense_Key=%02x, ASC=%02x ASCQ=%02x",
-                               dev, Sensedata->Sense_Key,
-                               Sensedata->ASC, Sensedata->ASCQ);
-                       switch(Sensedata->Sense_Key) {
-                               case NO_SENSE:
-                                       return MPATH_PR_NO_SENSE;
-                               case RECOVERED_ERROR:
-                                       return MPATH_PR_SUCCESS;
-                               case NOT_READY:
-                                       return MPATH_PR_SENSE_NOT_READY;
-                               case MEDIUM_ERROR:
-                                       return MPATH_PR_SENSE_MEDIUM_ERROR;
-                               case BLANK_CHECK:
-                                       return MPATH_PR_OTHER;
-                               case HARDWARE_ERROR:
-                                       return MPATH_PR_SENSE_HARDWARE_ERROR;
-                               case ILLEGAL_REQUEST:
-                                       return MPATH_PR_ILLEGAL_REQ;
-                               case UNIT_ATTENTION:
-                                       return MPATH_PR_SENSE_UNIT_ATTENTION;
-                               case DATA_PROTECT:
-                               case COPY_ABORTED:
-                                       return MPATH_PR_OTHER;
-                               case ABORTED_COMMAND:
-                                       return MPATH_PR_SENSE_ABORTED_COMMAND;
-
-                               default :
-                                       return MPATH_PR_OTHER;
-                       }
-               case SAM_STAT_RESERVATION_CONFLICT:
-                       return MPATH_PR_RESERV_CONFLICT;
+       case SAM_STAT_GOOD:
+               break;
+       case SAM_STAT_CHECK_CONDITION:
+               condlog(2, "%s: Sense_Key=%02x, ASC=%02x ASCQ=%02x",
+                       dev, Sensedata->Sense_Key,
+                       Sensedata->ASC, Sensedata->ASCQ);
+               switch(Sensedata->Sense_Key) {
+               case NO_SENSE:
+                       return MPATH_PR_NO_SENSE;
+               case RECOVERED_ERROR:
+                       return MPATH_PR_SUCCESS;
+               case NOT_READY:
+                       return MPATH_PR_SENSE_NOT_READY;
+               case MEDIUM_ERROR:
+                       return MPATH_PR_SENSE_MEDIUM_ERROR;
+               case BLANK_CHECK:
+                       return MPATH_PR_OTHER;
+               case HARDWARE_ERROR:
+                       return MPATH_PR_SENSE_HARDWARE_ERROR;
+               case ILLEGAL_REQUEST:
+                       return MPATH_PR_ILLEGAL_REQ;
+               case UNIT_ATTENTION:
+                       return MPATH_PR_SENSE_UNIT_ATTENTION;
+               case DATA_PROTECT:
+               case COPY_ABORTED:
+                       return MPATH_PR_OTHER;
+               case ABORTED_COMMAND:
+                       return MPATH_PR_SENSE_ABORTED_COMMAND;
 
                default :
-                       return  MPATH_PR_OTHER;
+                       return MPATH_PR_OTHER;
+               }
+       case SAM_STAT_RESERVATION_CONFLICT:
+               return MPATH_PR_RESERV_CONFLICT;
+
+       default :
+               return  MPATH_PR_OTHER;
        }
 
        switch(io_hdr.host_status) {
-               case DID_OK :
-                       break;
-               default :
-                       return MPATH_PR_OTHER;
+       case DID_OK :
+               break;
+       default :
+               return MPATH_PR_OTHER;
        }
        switch(io_hdr.driver_status)
        {
-               case DRIVER_OK:
-                       break;
-               default :
-                       return MPATH_PR_OTHER;
+       case DRIVER_OK:
+               break;
+       default :
+               return MPATH_PR_OTHER;
        }
        return MPATH_PR_SUCCESS;
 }
index a1c59fd..5636974 100644 (file)
@@ -107,37 +107,37 @@ int getprio (struct path * pp, char * args, unsigned int timeout)
                aas = (rc & 0x0f);
                priopath = (rc & 0x80);
                switch(aas) {
-                       case AAS_OPTIMIZED:
-                               rc = 50;
-                               break;
-                       case AAS_NON_OPTIMIZED:
-                               rc = 10;
-                               break;
-                       case AAS_LBA_DEPENDENT:
-                               rc = 5;
-                               break;
-                       case AAS_STANDBY:
-                               rc = 1;
-                               break;
-                       default:
-                               rc = 0;
+               case AAS_OPTIMIZED:
+                       rc = 50;
+                       break;
+               case AAS_NON_OPTIMIZED:
+                       rc = 10;
+                       break;
+               case AAS_LBA_DEPENDENT:
+                       rc = 5;
+                       break;
+               case AAS_STANDBY:
+                       rc = 1;
+                       break;
+               default:
+                       rc = 0;
                }
                if (priopath && (aas != AAS_OPTIMIZED || exclusive_pref))
                        rc += 80;
        } else {
                switch(-rc) {
-                       case ALUA_PRIO_NOT_SUPPORTED:
-                               condlog(0, "%s: alua not supported", pp->dev);
-                               break;
-                       case ALUA_PRIO_RTPG_FAILED:
-                               condlog(0, "%s: couldn't get target port group", pp->dev);
-                               break;
-                       case ALUA_PRIO_GETAAS_FAILED:
-                               condlog(0, "%s: couldn't get asymmetric access state", pp->dev);
-                               break;
-                       case ALUA_PRIO_TPGS_FAILED:
-                               condlog(3, "%s: couldn't get supported alua states", pp->dev);
-                               break;
+               case ALUA_PRIO_NOT_SUPPORTED:
+                       condlog(0, "%s: alua not supported", pp->dev);
+                       break;
+               case ALUA_PRIO_RTPG_FAILED:
+                       condlog(0, "%s: couldn't get target port group", pp->dev);
+                       break;
+               case ALUA_PRIO_GETAAS_FAILED:
+                       condlog(0, "%s: couldn't get asymmetric access state", pp->dev);
+                       break;
+               case ALUA_PRIO_TPGS_FAILED:
+                       condlog(3, "%s: couldn't get supported alua states", pp->dev);
+                       break;
                }
        }
        return rc;
index 2cf0a9c..a55865f 100644 (file)
@@ -720,37 +720,37 @@ void
 mpath_print_transport_id(struct prin_fulldescr *fdesc)
 {
        switch (fdesc->trnptid.protocol_id) {
-               case MPATH_PROTOCOL_ID_FC:
-                       printf("   FCP-2 ");
-                       if (0 != fdesc->trnptid.format_code)
-                               printf(" [Unexpected format code: %d]\n",
-                                               fdesc->trnptid.format_code);
-                       dumpHex((const char *)fdesc->trnptid.n_port_name, 8, 0);
-                       break;
-               case MPATH_PROTOCOL_ID_ISCSI:
-                       printf("   iSCSI ");
-                       if (0 == fdesc->trnptid.format_code) {
-                               printf("name: %.*s\n", (int)sizeof(fdesc->trnptid.iscsi_name),
+       case MPATH_PROTOCOL_ID_FC:
+               printf("   FCP-2 ");
+               if (0 != fdesc->trnptid.format_code)
+                       printf(" [Unexpected format code: %d]\n",
+                                       fdesc->trnptid.format_code);
+               dumpHex((const char *)fdesc->trnptid.n_port_name, 8, 0);
+               break;
+       case MPATH_PROTOCOL_ID_ISCSI:
+               printf("   iSCSI ");
+               if (0 == fdesc->trnptid.format_code) {
+                       printf("name: %.*s\n", (int)sizeof(fdesc->trnptid.iscsi_name),
+                               fdesc->trnptid.iscsi_name);
+               }else if (1 == fdesc->trnptid.format_code){
+                       printf("world wide unique port id: %.*s\n",
+                                       (int)sizeof(fdesc->trnptid.iscsi_name),
                                        fdesc->trnptid.iscsi_name);
-                       }else if (1 == fdesc->trnptid.format_code){
-                               printf("world wide unique port id: %.*s\n",
-                                               (int)sizeof(fdesc->trnptid.iscsi_name),
-                                               fdesc->trnptid.iscsi_name);
-                       }else {
-                               printf("  [Unexpected format code: %d]\n", fdesc->trnptid.format_code);
-                               dumpHex((const char *)fdesc->trnptid.iscsi_name,
-                                        (int)sizeof(fdesc->trnptid.iscsi_name), 0);
-                       }
-                       break;
-               case MPATH_PROTOCOL_ID_SAS:
-                       printf("   SAS ");
-                       if (0 != fdesc->trnptid.format_code)
-                               printf(" [Unexpected format code: %d]\n",
-                                               fdesc->trnptid.format_code);
-                       dumpHex((const char *)fdesc->trnptid.sas_address, 8, 0);
-                       break;
-               default:
-                       return;
+               }else {
+                       printf("  [Unexpected format code: %d]\n", fdesc->trnptid.format_code);
+                       dumpHex((const char *)fdesc->trnptid.iscsi_name,
+                                (int)sizeof(fdesc->trnptid.iscsi_name), 0);
+               }
+               break;
+       case MPATH_PROTOCOL_ID_SAS:
+               printf("   SAS ");
+               if (0 != fdesc->trnptid.format_code)
+                       printf(" [Unexpected format code: %d]\n",
+                                       fdesc->trnptid.format_code);
+               dumpHex((const char *)fdesc->trnptid.sas_address, 8, 0);
+               break;
+       default:
+               return;
        }
 }
 
index 20589a7..ec3b907 100644 (file)
@@ -2536,7 +2536,7 @@ main (int argc, char *argv[])
        udev = udev_new();
 
        while ((arg = getopt(argc, argv, ":dsv:k::Bn")) != EOF ) {
-       switch(arg) {
+               switch(arg) {
                case 'd':
                        foreground = 1;
                        if (logsink > 0)