LKML Archive on
help / color / mirror / Atom feed
From: "Alex G." <>
To: Keith Busch <>
	Jens Axboe <>, Christoph Hellwig <>,
	Sagi Grimberg <>,
Subject: Re: [PATCH] nvme-pci: Avoid use of goto in nvme_reset_work()
Date: Thu, 10 May 2018 12:01:33 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20180510170038.GA4556@localhost.localdomain>

On 05/10/2018 12:00 PM, Keith Busch wrote:
> 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
>> CC: Keith Busch <>
>> Signed-off-by: Alexandru Gagniuc <>
> Ah, that's just wrapping a function that has a single out. The challenge
> is to find a better mechanism than 'goto' to unwind a failure that has
> multiple outs, like nvme_probe().

The same principle applies there too. It might have to be wrapped in
several chunks, and it will likely be more readable. Am I supposed to
bite and refactor that too?


  reply	other threads:[~2018-05-10 17:01 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. [this message]
2018-05-11  6:37 ` Christoph Hellwig

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).