]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: rename identity to version
authorDaniel Wagner <dwagner@suse.de>
Thu, 24 Oct 2024 14:39:40 +0000 (16:39 +0200)
committerDaniel Wagner <wagi@monom.org>
Mon, 28 Oct 2024 18:38:51 +0000 (19:38 +0100)
Use the variable name consistently. The rest of the code base names this
variable as version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme.c

diff --git a/nvme.c b/nvme.c
index d1107ca16f337350ffdb9121b8c4f12c70120eab..959f45afad303fee3c882a7063869a92c569d9a8 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -9181,7 +9181,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl
        const char *secret =
            "Optional secret (in hexadecimal characters) to be used for the TLS key.";
        const char *hmac = "HMAC function to use for the retained key (1 = SHA-256, 2 = SHA-384).";
-       const char *identity = "TLS identity version to use (0 = NVMe TCP 1.0c, 1 = NVMe TCP 2.0";
+       const char *version = "TLS identity version to use (0 = NVMe TCP 1.0c, 1 = NVMe TCP 2.0";
        const char *hostnqn = "Host NQN for the retained key.";
        const char *subsysnqn = "Subsystem NQN for the retained key.";
        const char *keyring = "Keyring for the retained key.";
@@ -9202,7 +9202,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl
                char            *subsysnqn;
                char            *secret;
                unsigned char   hmac;
-               unsigned char   identity;
+               unsigned char   version;
                bool            insert;
        };
 
@@ -9213,7 +9213,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl
                .subsysnqn      = NULL,
                .secret         = NULL,
                .hmac           = 1,
-               .identity       = 0,
+               .version        = 0,
                .insert         = false,
        };
 
@@ -9224,7 +9224,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl
                  OPT_STR("subsysnqn",  'c', &cfg.subsysnqn,    subsysnqn),
                  OPT_STR("secret",     's', &cfg.secret,       secret),
                  OPT_BYTE("hmac",      'm', &cfg.hmac,         hmac),
-                 OPT_BYTE("identity",  'I', &cfg.identity,     identity),
+                 OPT_BYTE("identity",  'I', &cfg.version,      version),
                  OPT_FLAG("insert",    'i', &cfg.insert,       insert));
 
        err = parse_args(argc, argv, desc, opts);
@@ -9234,9 +9234,9 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl
                nvme_show_error("Invalid HMAC identifier %u", cfg.hmac);
                return -EINVAL;
        }
-       if (cfg.identity > 1) {
+       if (cfg.version > 1) {
                nvme_show_error("Invalid TLS identity version %u",
-                               cfg.identity);
+                               cfg.version);
                return -EINVAL;
        }
        if (cfg.insert) {
@@ -9288,7 +9288,7 @@ static int gen_tls_key(int argc, char **argv, struct command *command, struct pl
        if (cfg.insert) {
                tls_key = nvme_insert_tls_key_versioned(cfg.keyring,
                                        cfg.keytype, cfg.hostnqn,
-                                       cfg.subsysnqn, cfg.identity,
+                                       cfg.subsysnqn, cfg.version,
                                        cfg.hmac, raw_secret, key_len);
                if (tls_key <= 0) {
                        nvme_show_error("Failed to insert key, error %d", errno);