From 5292cad4e53011f39b45e5b1aee8afcf0a902a6b Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Fri, 24 Mar 2023 01:59:41 +0900 Subject: [PATCH] nvme-print: Fix nvme show status function indentation errors Signed-off-by: Tokunori Ikegami --- nvme-print.c | 53 ++++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 24 deletions(-) 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) -- 2.50.1