]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: Fix nvme show status function indentation errors
authorTokunori Ikegami <ikegami.t@gmail.com>
Thu, 23 Mar 2023 16:59:41 +0000 (01:59 +0900)
committerDaniel Wagner <wagi@monom.org>
Fri, 24 Mar 2023 13:05:10 +0000 (14:05 +0100)
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
nvme-print.c

index fc0cbeeae3ed5963b0f3640726a75b1546c7a176..ce4abe07506daab78dc8e14ce552da9643765666 100644 (file)
@@ -1741,30 +1741,35 @@ void d_raw(unsigned char *buf, unsigned len)
 
 void nvme_show_status(int status)
 {
-        int val = nvme_status_get_value(status);
-        int type = nvme_status_get_type(status);
-
-        /* Callers should be checking for negative values first, but provide a
-         * sensible fallback anyway
-         */
-        if (status < 0) {
-                fprintf(stderr, "Error: %s\n", nvme_strerror(errno));
-                return;
-        }
-
-        switch (type) {
-        case NVME_STATUS_TYPE_NVME:
-                fprintf(stderr, "NVMe status: %s(%#x)\n",
-                        nvme_status_to_string(val, false), val);
-                break;
-        case NVME_STATUS_TYPE_MI:
-                fprintf(stderr, "NVMe-MI status: %s(%#x)\n",
-                        nvme_mi_status_to_string(val), val);
-                break;
-        default:
-                fprintf(stderr, "Unknown status type %d, value %#x\n",
-                        type, val);
-        }
+       int val;
+       int type;
+
+       /*
+        * Callers should be checking for negative values first, but provide a
+        * sensible fallback anyway
+        */
+       if (status < 0) {
+               fprintf(stderr, "Error: %s\n", nvme_strerror(errno));
+               return;
+       }
+
+       val = nvme_status_get_value(status);
+       type = nvme_status_get_type(status);
+
+       switch (type) {
+       case NVME_STATUS_TYPE_NVME:
+               fprintf(stderr, "NVMe status: %s(%#x)\n",
+                       nvme_status_to_string(val, false), val);
+               break;
+       case NVME_STATUS_TYPE_MI:
+               fprintf(stderr, "NVMe-MI status: %s(%#x)\n",
+                       nvme_mi_status_to_string(val), val);
+               break;
+       default:
+               fprintf(stderr, "Unknown status type %d, value %#x\n", type,
+                       val);
+               break;
+       }
 }
 
 static void nvme_show_id_ctrl_cmic(__u8 cmic)