All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH] nvme-core: Share code between nvme_wait_ready() and nvme_shutdown_ctrl()
Date: Fri, 8 Mar 2019 14:23:55 +0100	[thread overview]
Message-ID: <20190308132355.GA18218@lst.de> (raw)
In-Reply-To: <20190207001312.13672-1-andrew.smirnov@gmail.com>

On Wed, Feb 06, 2019@04:13:12PM -0800, Andrey Smirnov wrote:
> Code polling NVME_CSTS_SHST_CMPLT in nvme_shutdown_ctrl() is very
> similar to polling loop in nvme_wait_ready(). Move shared polling loop
> code into __nvme_wait_ready() and re-implement both
> nvme_shutdown_ctrl() and nvme_wait_ready() on top of it to avoid code
> repetition.

Is there any deeper reason why we would want this?  It only saves
6 lines of code, but makes the functions much harder to read.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: linux-nvme@lists.infradead.org,
	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-core: Share code between nvme_wait_ready() and nvme_shutdown_ctrl()
Date: Fri, 8 Mar 2019 14:23:55 +0100	[thread overview]
Message-ID: <20190308132355.GA18218@lst.de> (raw)
In-Reply-To: <20190207001312.13672-1-andrew.smirnov@gmail.com>

On Wed, Feb 06, 2019 at 04:13:12PM -0800, Andrey Smirnov wrote:
> Code polling NVME_CSTS_SHST_CMPLT in nvme_shutdown_ctrl() is very
> similar to polling loop in nvme_wait_ready(). Move shared polling loop
> code into __nvme_wait_ready() and re-implement both
> nvme_shutdown_ctrl() and nvme_wait_ready() on top of it to avoid code
> repetition.

Is there any deeper reason why we would want this?  It only saves
6 lines of code, but makes the functions much harder to read.

  reply	other threads:[~2019-03-08 13:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-07  0:13 [PATCH] nvme-core: Share code between nvme_wait_ready() and nvme_shutdown_ctrl() Andrey Smirnov
2019-02-07  0:13 ` Andrey Smirnov
2019-03-08 13:23 ` Christoph Hellwig [this message]
2019-03-08 13:23   ` Christoph Hellwig
2019-03-08 18:58   ` Andrey Smirnov
2019-03-08 18:58     ` Andrey Smirnov

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=20190308132355.GA18218@lst.de \
    --to=hch@lst.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.