]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: Replace get feature command stderr output to nvme_show_error()
authorTokunori Ikegami <ikegami.t@gmail.com>
Thu, 12 Oct 2023 15:00:16 +0000 (00:00 +0900)
committerDaniel Wagner <wagi@monom.org>
Thu, 16 Nov 2023 10:05:54 +0000 (11:05 +0100)
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index f4b79efed98bd7f9feb50b8bb36c97e18a4b9f11..f203119cd1c90c436d4086c82b1b24d3ee23c406 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4586,7 +4586,7 @@ static void get_feature_id_print(struct feat_cfg cfg, int err, __u32 result,
                    !nvme_status_equals(status,  type, NVME_SC_INVALID_NS))
                        nvme_show_status(err);
        } else {
-               fprintf(stderr, "get-feature: %s\n", nvme_strerror(errno));
+               nvme_show_error("get-feature: %s", nvme_strerror(errno));
        }
 }
 
@@ -4649,9 +4649,8 @@ static int get_feature_ids(struct nvme_dev *dev, struct feat_cfg cfg)
                        continue;
                if (!nvme_status_equals(status, type, NVME_SC_INVALID_NS))
                        break;
-               fprintf(stderr, "get-feature:%#0*x (%s): ",
-                       cfg.feature_id ? 4 : 2, cfg.feature_id,
-                       nvme_feature_to_string(cfg.feature_id));
+               nvme_show_error("get-feature:%#0*x (%s): ", cfg.feature_id ? 4 : 2, cfg.feature_id,
+                               nvme_feature_to_string(cfg.feature_id));
                nvme_show_status(err);
        }