From: Gollu Appalanaidu Date: Fri, 5 Mar 2021 17:12:20 +0000 (+0530) Subject: nvme: use nvme_show_status when command status code is non-zero X-Git-Tag: v1.14~51 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3698f6607b3cd1b3f0ff860b76b3bea554c4700d;p=users%2Fsagi%2Fnvme-cli.git nvme: use nvme_show_status when command status code is non-zero 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 --- diff --git a/nvme.c b/nvme.c index 26539390..354d7af1 100644 --- 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);