]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: fix coding style issue
authorMax Gurtovoy <maxg@mellanox.com>
Thu, 30 May 2019 09:43:26 +0000 (12:43 +0300)
committerKeith Busch <keith.busch@gmail.com>
Fri, 7 Jun 2019 16:17:00 +0000 (10:17 -0600)
It's more common to use the following coding style:
if (condition) {
   do_that;
   do_this;
} else if (condition2) {
   do_this;
} else {
   do_that;
}

Reviewed-by: Minwoo Im <minwoo.im@samsung.com>
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 3310abd3b4637946ecf4c1eec4e3490844ef4c05..2fd4362028f7c07ede1d193de07e0d3126f106e3 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -988,11 +988,11 @@ static int list_ns(int argc, char **argv, struct command *cmd, struct plugin *pl
                for (i = 0; i < 1024; i++)
                        if (ns_list[i])
                                printf("[%4u]:%#x\n", i, le32_to_cpu(ns_list[i]));
-       }
-       else if (err > 0)
+       } else if (err > 0) {
                show_nvme_status(err);
-       else
+       } else {
                perror("id namespace list");
+       }
 
 close_fd:
        close(fd);