All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-nvme@lists.infradead.org
Cc: kbusch@kernel.org, hch@lst.de, sagi@grimberg.me,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: [PATCH 3/4] nvmet: use nvme_nidt_len() helper for id-desc
Date: Mon, 17 May 2021 22:05:56 -0700	[thread overview]
Message-ID: <20210518050557.14961-4-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20210518050557.14961-1-chaitanya.kulkarni@wdc.com>

Use the previously added helper to remove the open coding of the
NVME_NIDT_XXX_LEN for target.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 drivers/nvme/target/admin-cmd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index dcd49a72f2f3..1a58719ef952 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -7,6 +7,7 @@
 #include <linux/module.h>
 #include <linux/rculist.h>
 #include <linux/part_stat.h>
+#include <linux/nvme.h>
 
 #include <generated/utsrelease.h>
 #include <asm/unaligned.h>
@@ -622,15 +623,16 @@ static void nvmet_execute_identify_desclist(struct nvmet_req *req)
 
 	if (memchr_inv(&req->ns->uuid, 0, sizeof(req->ns->uuid))) {
 		status = nvmet_copy_ns_identifier(req, NVME_NIDT_UUID,
-						  NVME_NIDT_UUID_LEN,
+						  nvme_nidt_len(NVME_NIDT_UUID),
 						  &req->ns->uuid, &off);
 		if (status)
 			goto out;
 	}
 	if (memchr_inv(req->ns->nguid, 0, sizeof(req->ns->nguid))) {
+		u8 len = nvme_nidt_len(NVME_NIDT_NGUID);
+
 		status = nvmet_copy_ns_identifier(req, NVME_NIDT_NGUID,
-						  NVME_NIDT_NGUID_LEN,
-						  &req->ns->nguid, &off);
+						  len, &req->ns->nguid, &off);
 		if (status)
 			goto out;
 	}
-- 
2.22.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2021-05-18  5:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  5:05 [PATCH 0/4] nvme: nidt and ns-desc related clanup Chaitanya Kulkarni
2021-05-18  5:05 ` [PATCH 1/4] nvme: calculate data offset once for ns-desc Chaitanya Kulkarni
2021-05-18  5:05 ` [PATCH 2/4] nvme-core: add a helper to get the len from nid Chaitanya Kulkarni
2021-05-18  5:05 ` Chaitanya Kulkarni [this message]
2021-05-18  5:05 ` [PATCH 4/4] nvme-core: remove the NVME_NIDT_XXX_LEN macros Chaitanya Kulkarni
2021-05-18  6:49 ` [PATCH 0/4] nvme: nidt and ns-desc related clanup Christoph Hellwig
2021-05-18 20:29   ` Chaitanya Kulkarni

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=20210518050557.14961-4-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.