LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Cc: linux-nvme@lists.infradead.org, alex_gagniuc@dellteam.com,
Austin.Bolen@dell.com, Shyam.Iyer@dell.com,
Keith Busch <keith.busch@intel.com>, Jens Axboe <axboe@fb.com>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
linux-kernel@vger.kernel.org
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: <20180511063724.GA8368@lst.de> (raw)
In-Reply-To: <20180510164645.19559-1-mr.nuke.me@gmail.com>
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".
prev 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:
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=20180511063724.GA8368@lst.de \
--to=hch@lst.de \
--cc=Austin.Bolen@dell.com \
--cc=Shyam.Iyer@dell.com \
--cc=alex_gagniuc@dellteam.com \
--cc=axboe@fb.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=mr.nuke.me@gmail.com \
--cc=sagi@grimberg.me \
--subject='Re: [PATCH] nvme-pci: Avoid use of goto in nvme_reset_work()' \
/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
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).