From: James Smart <james.smart@broadcom.com>
To: Johannes Thumshirn <jthumshirn@suse.de>,
Keith Busch <keith.busch@intel.com>, Jens Axboe <axboe@fb.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Sagi Grimberg <sagi@grimberg.me>,
Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-fabrics: simplify error handling of nvme_fc_create_hw_io_queues
Date: Thu, 15 Dec 2016 08:37:21 -0800 [thread overview]
Message-ID: <82b700f4-7a4c-777d-e7c2-b934548a71ba@broadcom.com> (raw)
In-Reply-To: <20161215132048.12645-1-jthumshirn@suse.de>
Looks fine
-- james
Signed-off-by: James Smart <james.smart@broadcom.com>
On 12/15/2016 5:20 AM, Johannes Thumshirn wrote:
> 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>
> ---
> drivers/nvme/host/fc.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> index 771e2e7..ca2fd02 100644
> --- a/drivers/nvme/host/fc.c
> +++ b/drivers/nvme/host/fc.c
> @@ -1491,19 +1491,20 @@ enum {
> nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize)
> {
> struct nvme_fc_queue *queue = &ctrl->queues[1];
> - int i, j, ret;
> + int i, ret;
>
> for (i = 1; i < ctrl->queue_count; i++, queue++) {
> ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize);
> - if (ret) {
> - for (j = i-1; j >= 0; j--)
> - __nvme_fc_delete_hw_queue(ctrl,
> - &ctrl->queues[j], j);
> - return ret;
> - }
> + if (ret)
> + goto delete_queues;
> }
>
> return 0;
> +
> +delete_queues:
> + for (; i >= 0; i--)
> + __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i);
> + return ret;
> }
>
> static int
prev parent reply other threads:[~2016-12-15 16:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 13:20 Johannes Thumshirn
2016-12-15 16:37 ` James Smart [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82b700f4-7a4c-777d-e7c2-b934548a71ba@broadcom.com \
--to=james.smart@broadcom.com \
--cc=axboe@fb.com \
--cc=hch@infradead.org \
--cc=jthumshirn@suse.de \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®