All of lore.kernel.org
 help / color / mirror / Atom feed
From: james.smart@broadcom.com (James Smart)
Subject: [PATCH v2 1/3] nvme: have nvme_init_identify set ctrl->cap
Date: Tue, 23 Jul 2019 08:59:47 -0700	[thread overview]
Message-ID: <0b926f73-c439-7057-dcb8-75e89486f084@broadcom.com> (raw)
In-Reply-To: <20190723000654.6448-2-sagi@grimberg.me>



On 7/22/2019 5:06 PM, 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);
>   	if (ret) {
>   		dev_err(ctrl->device, "Reading CAP failed (%d)\n", ret);
>   		return ret;
>   	}

wondering why we're re-reading CAP if it was already done in 
nvme_enable_ctrl()


-- james

  parent reply	other threads:[~2019-07-23 15:59 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
2019-07-23 15:59   ` James Smart [this message]
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=0b926f73-c439-7057-dcb8-75e89486f084@broadcom.com \
    --to=james.smart@broadcom.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 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.