]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: use NVME_GET_FEATURES_SEL_SUPPORTED definition
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 8 Sep 2024 10:05:56 +0000 (19:05 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 9 Sep 2024 07:40:29 +0000 (09:40 +0200)
This is to delete the hardcoded values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 900b1c0e190509e3fc84f3b94567a337f9fef6f2..40c6c5943bd095493694b6d8aa4e9fe9ec4daaae 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -4553,7 +4553,7 @@ static int get_feature_id(struct nvme_dev *dev, struct feat_cfg *cfg,
                cfg->cdw11 |= 0xff << 16;
        }
 
-       if (cfg->sel == 3)
+       if (cfg->sel == NVME_GET_FEATURES_SEL_SUPPORTED)
                cfg->data_len = 0;
 
        if (cfg->data_len) {
@@ -4592,7 +4592,7 @@ static void get_feature_id_print(struct feat_cfg cfg, int err, __u32 result,
        if (!err) {
                if (!cfg.raw_binary || !buf) {
                        nvme_feature_show(cfg.feature_id, cfg.sel, result);
-                       if (cfg.sel == 3)
+                       if (cfg.sel == NVME_GET_FEATURES_SEL_SUPPORTED)
                                nvme_show_select_result(cfg.feature_id, result);
                        else if (cfg.human_readable)
                                nvme_feature_show_fields(cfg.feature_id, result,