Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: [PATCH v2 1/3] nvme: have nvme_init_identify set ctrl->cap
Date: Tue, 23 Jul 2019 22:43:22 +0900	[thread overview]
Message-ID: <20190723134322.GD7148@minwoo-desktop> (raw)
In-Reply-To: <20190723000654.6448-2-sagi@grimberg.me>

On 19-07-22 17:06:52, Sagi Grimberg wrote:
> No need to use a stack cap variable.
> 
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
>  drivers/nvme/host/core.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 76cd3dd8736a..058e06e40df8 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2563,7 +2563,6 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl)
>  int nvme_init_identify(struct nvme_ctrl *ctrl)
>  {
>  	struct nvme_id_ctrl *id;
> -	u64 cap;
>  	int ret, page_shift;
>  	u32 max_hw_sectors;
>  	bool prev_apst_enabled;
> @@ -2574,15 +2573,15 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
>  		return ret;
>  	}
>  
> -	ret = ctrl->ops->reg_read64(ctrl, NVME_REG_CAP, &cap);
> +	ret = ctrl->ops->reg_read64(ctrl, NVME_REG_CAP, &ctrl->cap);

I think the host drivers already have the CAP values before the
nvme_init_identify() being called.  But it looks good to me with the
goal of this commit.

Reviewed-by: Minwoo Im <minwoo.im.dev at gmail.com>

  reply	other threads:[~2019-07-23 13:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  0:06 [PATCH v2 0/3] small set of nvme cleanups Sagi Grimberg
2019-07-23  0:06 ` [PATCH v2 1/3] nvme: have nvme_init_identify set ctrl->cap Sagi Grimberg
2019-07-23 13:43   ` Minwoo Im [this message]
2019-07-23 15:59   ` James Smart
2019-07-23 17:31     ` Sagi Grimberg
2019-07-23  0:06 ` [PATCH v2 2/3] nvme: move sqsize setting to the core Sagi Grimberg
2019-07-23 13:58   ` Minwoo Im
2019-07-23  0:06 ` [PATCH v2 3/3] nvme: don't pass cap to nvme_disable_ctrl Sagi Grimberg
2019-07-23 13:59   ` Minwoo Im

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=20190723134322.GD7148@minwoo-desktop \
    --to=minwoo.im.dev@gmail.com \
    /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