linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <kch@nvidia.com>
To: <hare@suse.de>
Cc: <hch@lst.de>, <sagi@grimberg.me>,
	<linux-nvme@lists.infradead.org>, <kbusch@kernel.org>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH V3 3/3] nvmet-auth: use correct type for status variable
Date: Mon, 5 Jun 2023 02:19:20 -0700	[thread overview]
Message-ID: <20230605091920.34253-4-kch@nvidia.com> (raw)
In-Reply-To: <20230605091920.34253-1-kch@nvidia.com>

The dhchap_step member of structure nvmet_sq holds the following values:

        NVME_AUTH_DHCHAP_FAILURE_FAILED                 = 0x01,
        NVME_AUTH_DHCHAP_FAILURE_NOT_USABLE             = 0x02,
        NVME_AUTH_DHCHAP_FAILURE_CONCAT_MISMATCH        = 0x03,
        NVME_AUTH_DHCHAP_FAILURE_HASH_UNUSABLE          = 0x04,
        NVME_AUTH_DHCHAP_FAILURE_DHGROUP_UNUSABLE       = 0x05,
        NVME_AUTH_DHCHAP_FAILURE_INCORRECT_PAYLOAD      = 0x06,
        NVME_AUTH_DHCHAP_FAILURE_INCORRECT_MESSAGE      = 0x07,

These values can never be negative, hence change int type of
dhchap_step to u16 in the nvmet_sq struct.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/target/nvmet.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 6cf723bc664e..66d8673c3ebf 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -113,7 +113,7 @@ struct nvmet_sq {
 	struct delayed_work	auth_expired_work;
 	u16			dhchap_tid;
 	u16			dhchap_status;
-	int			dhchap_step;
+	u16			dhchap_step;
 	u8			*dhchap_c1;
 	u8			*dhchap_c2;
 	u32			dhchap_s1;
-- 
2.40.0



  parent reply	other threads:[~2023-06-05  9:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05  9:19 [PATCH V3 0/3] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
2023-06-05  9:19 ` [PATCH V3 1/3] nvmet-auth: use common helper to check secp/spsp Chaitanya Kulkarni
2023-06-05 21:56   ` Sagi Grimberg
2023-06-07 10:59   ` Max Gurtovoy
2023-06-05  9:19 ` [PATCH V3 2/3] nvmet_auth: use common helper for buffer alloc Chaitanya Kulkarni
2023-06-05 22:02   ` Sagi Grimberg
2023-06-08 12:41     ` Max Gurtovoy
2023-06-05  9:19 ` Chaitanya Kulkarni [this message]
2023-06-05 22:27   ` [PATCH V3 3/3] nvmet-auth: use correct type for status variable Sagi Grimberg
2023-06-05  9:24 ` [PATCH V3 0/3] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
2023-06-05 22:27   ` Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230605091920.34253-4-kch@nvidia.com \
    --to=kch@nvidia.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).