Skip to content

Commit af5d6f7

Browse files
ChaitanayaKulkarniChristoph Hellwig
authored andcommitted
nvme-core: remove extra variable
In nvme_validate_ns() the exra variable ctrl is used only twice. Using ns->ctrl directly still maintains the redability and original length of the lines in the code. Get rid of the extra variable ctrl & use ns->ctrl directly. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 7b15336 commit af5d6f7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3928,20 +3928,19 @@ static void nvme_ns_remove_by_nsid(struct nvme_ctrl *ctrl, u32 nsid)
39283928

39293929
static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)
39303930
{
3931-
struct nvme_ctrl *ctrl = ns->ctrl;
39323931
struct nvme_id_ns *id;
39333932
int ret = -ENODEV;
39343933

39353934
if (test_bit(NVME_NS_DEAD, &ns->flags))
39363935
goto out;
39373936

3938-
ret = nvme_identify_ns(ctrl, ns->head->ns_id, ids, &id);
3937+
ret = nvme_identify_ns(ns->ctrl, ns->head->ns_id, ids, &id);
39393938
if (ret)
39403939
goto out;
39413940

39423941
ret = -ENODEV;
39433942
if (!nvme_ns_ids_equal(&ns->head->ids, ids)) {
3944-
dev_err(ctrl->device,
3943+
dev_err(ns->ctrl->device,
39453944
"identifiers changed for nsid %d\n", ns->head->ns_id);
39463945
goto out_free_id;
39473946
}

0 commit comments

Comments
 (0)