diff options
author | Johannes Thumshirn <jthumshirn@suse.de> | 2016-12-15 08:20:48 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2016-12-21 05:34:25 -0500 |
commit | 17a1ec08ce7074f05795e5c32a3e5bc9a797bbf8 (patch) | |
tree | 0e31831c2502e15d1eeba1de56f2aa8cb27635a8 | |
parent | c703489885218900579279cec4b4ab8e7fce383b (diff) |
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>
-rw-r--r-- | drivers/nvme/host/fc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 827c2b57e5bb..aa0bc60810a7 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c | |||
@@ -1491,19 +1491,20 @@ static int | |||
1491 | nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) | 1491 | nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) |
1492 | { | 1492 | { |
1493 | struct nvme_fc_queue *queue = &ctrl->queues[1]; | 1493 | struct nvme_fc_queue *queue = &ctrl->queues[1]; |
1494 | int i, j, ret; | 1494 | int i, ret; |
1495 | 1495 | ||
1496 | for (i = 1; i < ctrl->queue_count; i++, queue++) { | 1496 | for (i = 1; i < ctrl->queue_count; i++, queue++) { |
1497 | ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize); | 1497 | ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize); |
1498 | if (ret) { | 1498 | if (ret) |
1499 | for (j = i-1; j >= 0; j--) | 1499 | goto delete_queues; |
1500 | __nvme_fc_delete_hw_queue(ctrl, | ||
1501 | &ctrl->queues[j], j); | ||
1502 | return ret; | ||
1503 | } | ||
1504 | } | 1500 | } |
1505 | 1501 | ||
1506 | return 0; | 1502 | return 0; |
1503 | |||
1504 | delete_queues: | ||
1505 | for (; i >= 0; i--) | ||
1506 | __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i); | ||
1507 | return ret; | ||
1507 | } | 1508 | } |
1508 | 1509 | ||
1509 | static int | 1510 | static int |