提交 adce7e98 编写于 作者: E Edmund Nadolski 提交者: Keith Busch

nvme: remove unused return code from nvme_alloc_ns

The return code of nvme_alloc_ns is never used, so change it
to void.
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NEdmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: NKeith Busch <kbusch@kernel.org>
上级 8b614cb8
......@@ -3480,7 +3480,7 @@ static int nvme_setup_streams_ns(struct nvme_ctrl *ctrl, struct nvme_ns *ns)
return 0;
}
static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
{
struct nvme_ns *ns;
struct gendisk *disk;
......@@ -3490,13 +3490,11 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
ns = kzalloc_node(sizeof(*ns), GFP_KERNEL, node);
if (!ns)
return -ENOMEM;
return;
ns->queue = blk_mq_init_queue(ctrl->tagset);
if (IS_ERR(ns->queue)) {
ret = PTR_ERR(ns->queue);
if (IS_ERR(ns->queue))
goto out_free_ns;
}
if (ctrl->opts && ctrl->opts->data_digest)
ns->queue->backing_dev_info->capabilities
......@@ -3519,10 +3517,8 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
if (ret)
goto out_free_queue;
if (id->ncap == 0) {
ret = -EINVAL;
if (id->ncap == 0) /* no namespace (legacy quirk) */
goto out_free_id;
}
ret = nvme_init_ns_head(ns, nsid, id);
if (ret)
......@@ -3531,10 +3527,8 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
nvme_set_disk_name(disk_name, ns, ctrl, &flags);
disk = alloc_disk_node(0, node);
if (!disk) {
ret = -ENOMEM;
if (!disk)
goto out_unlink_ns;
}
disk->fops = &nvme_fops;
disk->private_data = ns;
......@@ -3565,7 +3559,7 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
nvme_fault_inject_init(&ns->fault_inject, ns->disk->disk_name);
kfree(id);
return 0;
return;
out_put_disk:
put_disk(ns->disk);
out_unlink_ns:
......@@ -3579,9 +3573,6 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
blk_cleanup_queue(ns->queue);
out_free_ns:
kfree(ns);
if (ret > 0)
ret = blk_status_to_errno(nvme_error_status(ret));
return ret;
}
static void nvme_ns_remove(struct nvme_ns *ns)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册