All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: linux-nvme@lists.infradead.org
Cc: hch@lst.de, Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	sagi@grimberg.me
Subject: [PATCH V3 04/11] nvmet: remove extra variable in id-ns handler
Date: Tue,  9 Feb 2021 21:47:55 -0800	[thread overview]
Message-ID: <20210210054802.34269-5-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20210210054802.34269-1-chaitanya.kulkarni@wdc.com>

In nvmet_execute_identify_ns() local variable ctrl is accessed only in
one place, remove that and directly use it from nvmet_req->sq->ctrl.

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

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index f32533480e66..552da813da18 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -462,7 +462,6 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
 
 static void nvmet_execute_identify_ns(struct nvmet_req *req)
 {
-	struct nvmet_ctrl *ctrl = req->sq->ctrl;
 	struct nvme_id_ns *id;
 	u16 status;
 
@@ -523,7 +522,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
 
 	id->lbaf[0].ds = req->ns->blksize_shift;
 
-	if (ctrl->pi_support && nvmet_ns_has_pi(req->ns)) {
+	if (req->sq->ctrl->pi_support && nvmet_ns_has_pi(req->ns)) {
 		id->dpc = NVME_NS_DPC_PI_FIRST | NVME_NS_DPC_PI_LAST |
 			  NVME_NS_DPC_PI_TYPE1 | NVME_NS_DPC_PI_TYPE2 |
 			  NVME_NS_DPC_PI_TYPE3;
-- 
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-02-10  5:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  5:47 [PATCH V3 00/11] nvmet: fixes and some cleanups Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 01/11] nvmet: set status to 0 in case for invalid nsid Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 02/11] nvmet: return uniform error for invalid ns Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 03/11] nvmet: make nvmet_find_namespace() req based Chaitanya Kulkarni
2021-02-10  5:47 ` Chaitanya Kulkarni [this message]
2021-02-10  5:47 ` [PATCH V3 05/11] nvmet: add helper to report invalid opcode Chaitanya Kulkarni
2021-02-10  8:12   ` Christoph Hellwig
2021-02-10  5:47 ` [PATCH V3 06/11] nvmet: use invalid cmd opcode helper Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 07/11] " Chaitanya Kulkarni
2021-02-10  5:47 ` [PATCH V3 08/11] nvmet: use min of device_path and disk len Chaitanya Kulkarni
2021-02-10  8:13   ` Christoph Hellwig
2021-02-10  5:48 ` [PATCH V3 09/11] nvme-loop: rename variable to get rid of the warn Chaitanya Kulkarni
2021-02-10  8:13   ` Christoph Hellwig
2021-02-10  8:18     ` Chaitanya Kulkarni
2021-02-10  8:23       ` Christoph Hellwig
2021-02-10  5:48 ` [PATCH V3 10/11] nvmet: add nvmet_req_subsys() helper Chaitanya Kulkarni
2021-02-10  5:48 ` [PATCH V3 11/11] nvmet: remove else at the end of the function Chaitanya Kulkarni
2021-02-10  8:11 ` [PATCH V3 00/11] nvmet: fixes and some cleanups Christoph Hellwig
2021-02-10  8:52   ` 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=20210210054802.34269-5-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --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.