diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2019-07-22 17:06:52 -0700 |
---|---|---|
committer | Sagi Grimberg <sagi@grimberg.me> | 2019-08-29 12:55:00 -0700 |
commit | 4fba445828fc047c095a3a955b4ceac62cd56964 (patch) | |
tree | acd9e0ffcbb12dd44f3e41e0032ef613d1aed681 /drivers | |
parent | 10407ec9b42d30a6ebc49f7f84e2bb2131438699 (diff) | |
download | linux-4fba445828fc047c095a3a955b4ceac62cd56964.tar.bz2 |
nvme: have nvme_init_identify set ctrl->cap
No need to use a stack cap variable.
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/core.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 4ba374633dc8..f325e9516849 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2562,7 +2562,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; @@ -2573,15 +2572,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; } - page_shift = NVME_CAP_MPSMIN(cap) + 12; + page_shift = NVME_CAP_MPSMIN(ctrl->cap) + 12; if (ctrl->vs >= NVME_VS(1, 1, 0)) - ctrl->subsystem = NVME_CAP_NSSRC(cap); + ctrl->subsystem = NVME_CAP_NSSRC(ctrl->cap); ret = nvme_identify_ctrl(ctrl, &id); if (ret) { |