]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: use nvme_show_status when command status code is non-zero
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Fri, 5 Mar 2021 17:12:20 +0000 (22:42 +0530)
committerKeith Busch <kbusch@kernel.org>
Tue, 9 Mar 2021 18:14:42 +0000 (11:14 -0700)
Show the command return status code along with details with the
help of nvme_show_status instead of printing the err.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 26539390814cecfedb484b9779bb653638b58fb3..354d7af168a2ab0baf4c9f11cfb269e73a007056 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4574,7 +4574,7 @@ static int resv_report(int argc, char **argv, struct command *cmd, struct plugin
        if (!err)
                nvme_show_resv_report(status, size, cfg.cdw11, flags);
        else if (err > 0)
-               fprintf(stderr, "NVME IO command error:%04x\n", err);
+               nvme_show_status(err);
        else
                perror("reservation report");
        free(status);
@@ -5131,7 +5131,7 @@ static int get_lba_status(int argc, char **argv, struct command *cmd,
        if (!err)
                nvme_show_lba_status(buf, buf_len, flags);
        else if (err > 0)
-               fprintf(stderr, "NVME command error:%04x\n", err);
+               nvme_show_status(err);
        else
                perror("get lba status");
        free(buf);