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 05/10] nvmet: remove extra variable in is-ns handler
Date: Sun, 31 Jan 2021 21:41:33 -0800	[thread overview]
Message-ID: <20210201054138.34324-6-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20210201054138.34324-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 ec64218db03c..d4e8f76ae59a 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -465,7 +465,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 = 0;
 
@@ -531,7 +530,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-01  5:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  5:41 [PATCH 00/10] nvmet: fixes and some cleanups Chaitanya Kulkarni
2021-02-01  5:41 ` [PATCH 01/10] nvmet: zeroout id-ns buffer for invalid nsid Chaitanya Kulkarni
2021-02-01 17:24   ` Christoph Hellwig
2021-02-02  0:12     ` Chaitanya Kulkarni
2021-02-02  9:38       ` Christoph Hellwig
2021-02-03  4:31         ` Chaitanya Kulkarni
2021-02-01  5:41 ` [PATCH 02/10] nvmet: return uniform error for invalid ns Chaitanya Kulkarni
2021-02-01  5:41 ` [PATCH 03/10] nvmet: set error in nvmet_find_namespace() Chaitanya Kulkarni
2021-02-01 17:27   ` Christoph Hellwig
2021-02-02  0:13     ` Chaitanya Kulkarni
2021-02-01  5:41 ` [PATCH 04/10] nvmet: remove nsid param from nvmet_find_namespace() Chaitanya Kulkarni
2021-02-01 17:28   ` Christoph Hellwig
2021-02-02  0:13     ` Chaitanya Kulkarni
2021-02-01  5:41 ` Chaitanya Kulkarni [this message]
2021-02-01  5:41 ` [PATCH 06/10] nvmet: add helper to report invalid opcode Chaitanya Kulkarni
2021-02-01 17:29   ` Christoph Hellwig
2021-02-02  0:14     ` Chaitanya Kulkarni
2021-02-02  9:39       ` Christoph Hellwig
2021-02-01  5:41 ` [PATCH 07/10] nvmet: use invalid cmd opcode helper Chaitanya Kulkarni
2021-02-01  5:41 ` [PATCH 08/10] " Chaitanya Kulkarni
2021-02-01  5:41 ` [PATCH 09/10] nvmet: use min of device_path and disk len Chaitanya Kulkarni
2021-02-01  5:41 ` [PATCH 10/10] nvme-loop: rename variable to get rid of the warn 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=20210201054138.34324-6-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.