LKML Archive on
help / color / mirror / Atom feed
From: Christoph Hellwig <>
To: Alexandru Gagniuc <>
	Keith Busch <>, Jens Axboe <>,
	Christoph Hellwig <>, Sagi Grimberg <>,
Subject: Re: [PATCH] nvme-pci: Avoid use of goto in nvme_reset_work()
Date: Fri, 11 May 2018 08:37:24 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, May 10, 2018 at 11:46:33AM -0500, Alexandru Gagniuc wrote:
> This patch started as a challenge from Keith relating to code
> structuring with goto vs return. I think the final result improves
> readability on two counts:
> First, it clarifies the separation between work struct and nvme_dev.
> Second, it makes it clearer what error is being passed on:
> 'return -ENODEV' vs 'goto out', where 'result' happens to be -ENODEV

I think this actually makes the code much less readable.  The only real
improvement the code needs is to replace the "out" label name with
something more descriptive like "remove_controller".

      parent reply	other threads:[~2018-05-11  6:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 16:46 Alexandru Gagniuc
2018-05-10 17:00 ` Keith Busch
2018-05-10 17:01   ` Alex G.
2018-05-11  6:37 ` Christoph Hellwig [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] nvme-pci: Avoid use of goto in nvme_reset_work()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).