From: Yongsoo Joo <ysjoo@kookmin.ac.kr>
To: Keith Busch <kbusch@kernel.org>
Cc: axboe@kernel.dk, hch@lst.de, sagi@grimberg.me,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: fix return type of nvme_poll()
Date: Sun, 8 Dec 2024 06:24:30 +0000 [thread overview]
Message-ID: <Z1U7npo/DINh2MR9@ubuntu> (raw)
In-Reply-To: <Z1UOyFnUavHNJu5H@kbusch-mbp.dhcp.thefacebook.com>
On Sat, Dec 07, 2024 at 08:13:12PM -0700, Keith Busch wrote:
> On Sat, Dec 07, 2024 at 04:55:46AM +0000, Yongsoo Joo wrote:
> > Change the type of the return variable 'found' from bool to int so
> > that any interested caller can see not only whether at least one
> > CQE was processed, but also the total number of CQEs processed.
>
> It looks like all the interested callers only care if it's not 0, so I'm
> not sure this is a "fix" as the subject says.
I agree that all the "current" interested callers seem to expect
boolean-like return values from nvme_poll(). However, the return
type of both nvme_poll() and nvme_poll_cq() is int, and
nvme_poll_cq() actually returns the number of processed CQEs.
The inconsistency between the two functions is, in my view, worth
addressing to prevent potential confusion for potential callers who
are interested the actual numbers. And this patch is
backward-compatible with the current usage, so no changes are
required for the existing callers.
I’d like to ask for your opinion on the followings:
- Do you think rephrasing the patch title to “nvme: change return
type of nvme_poll()” would be more appropriate?
- Do you believe it would make more sense to change the return
type of nvme_poll() from int to bool instead?
- Or, do you think this inconsistency is not a big issue, and the
current implementation is sufficient as it stands?
Thanks for your time and feedback. I look forward to your thoughts.
--
next prev parent reply other threads:[~2024-12-08 6:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 4:55 [PATCH] nvme: fix return type of nvme_poll() Yongsoo Joo
2024-12-08 3:13 ` Keith Busch
2024-12-08 6:24 ` Yongsoo Joo [this message]
2024-12-09 7:58 ` Christoph Hellwig
2024-12-09 13:28 ` Yongsoo Joo
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=Z1U7npo/DINh2MR9@ubuntu \
--to=ysjoo@kookmin.ac.kr \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@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