From: Tokunori Ikegami Date: Thu, 23 Mar 2023 16:59:41 +0000 (+0900) Subject: nvme-print: Fix nvme show status function indentation errors X-Git-Tag: v2.4~16 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5292cad4e53011f39b45e5b1aee8afcf0a902a6b;p=users%2Fsagi%2Fnvme-cli.git nvme-print: Fix nvme show status function indentation errors Signed-off-by: Tokunori Ikegami --- diff --git a/nvme-print.c b/nvme-print.c index fc0cbeea..ce4abe07 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -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)