mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
nvme/fc: simplify error handling of nvme_fc_create_hw_io_queues
Simplify the error handling of nvme_fc_create_hw_io_queues(), this saves us one variable and one level of indentation. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviwed-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
c703489885
commit
17a1ec08ce
|
|
@ -1491,19 +1491,20 @@ static int
|
||||||
nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize)
|
nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize)
|
||||||
{
|
{
|
||||||
struct nvme_fc_queue *queue = &ctrl->queues[1];
|
struct nvme_fc_queue *queue = &ctrl->queues[1];
|
||||||
int i, j, ret;
|
int i, ret;
|
||||||
|
|
||||||
for (i = 1; i < ctrl->queue_count; i++, queue++) {
|
for (i = 1; i < ctrl->queue_count; i++, queue++) {
|
||||||
ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize);
|
ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize);
|
||||||
if (ret) {
|
if (ret)
|
||||||
for (j = i-1; j >= 0; j--)
|
goto delete_queues;
|
||||||
__nvme_fc_delete_hw_queue(ctrl,
|
|
||||||
&ctrl->queues[j], j);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
delete_queues:
|
||||||
|
for (; i >= 0; i--)
|
||||||
|
__nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user