]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Fixing a get and set features
authorKeith Busch <keith.busch@intel.com>
Thu, 3 Mar 2016 14:32:18 +0000 (07:32 -0700)
committerKeith Busch <keith.busch@intel.com>
Thu, 3 Mar 2016 14:32:18 +0000 (07:32 -0700)
The get feature argument for extensive decoding for readibility is 'H'
rather than 'h', and a set feature value can be 0xffffffff, so fixing
that bogus check.

Signed-off-by: Keith Busch <keith.busch@intel.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index 8876c7398908b93bb104138f3b5461328dc5b18e..fd2187a6cd47c75b6e8f050b4e71220898d71cf7 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1026,7 +1026,7 @@ static int get_feature(int argc, char **argv)
                {"data-len",       'l', "NUM", CFG_POSITIVE, &cfg.data_len,       required_argument, data_len},
                {"raw-binary",     'b', "FLAG",CFG_NONE,     &cfg.raw_binary,     no_argument,       raw_binary},
                {"cdw11",          'c', "NUM", CFG_POSITIVE, &cfg.cdw11,          required_argument, cdw11},
-               {"human-readable", 'h', "FLAG",CFG_NONE,     &cfg.human_readable, no_argument,       human_readable},
+               {"human-readable", 'H', "FLAG",CFG_NONE,     &cfg.human_readable, no_argument,       human_readable},
                {0}
        };
 
@@ -1404,10 +1404,6 @@ static int set_feature(int argc, char **argv)
 
        get_dev(1, argc, argv);
 
-       if (cfg.value == -1) {
-               fprintf(stderr, "feature value required param\n");
-               return EINVAL;
-       }
        if (!cfg.feature_id) {
                fprintf(stderr, "feature-id required param\n");
                return EINVAL;