From: Christoph Hellwig <hch@lst.de>
To: Daniel Wagner <dwagner@suse.de>
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: libnvme API design
Date: Mon, 13 Oct 2025 08:47:00 +0200 [thread overview]
Message-ID: <20251013064700.GA2140@lst.de> (raw)
In-Reply-To: <204cb4cc-33b4-40ce-8554-13436048f8d4@flourine.local>
On Fri, Oct 10, 2025 at 10:44:39AM +0200, Daniel Wagner wrote:
> > > cmd->cdw11 |= NVME_SET(nvmsetid, IDENTIFY_CDW11_CNSSPECID);
> >
> > And NVME_SET still feels very oddly name..
>
> It's on the TODO list but we might address this at the same time indeed.
>
> Is it just the name or the macro itself?
>
> Something like NVME_FIELD_PREP, REG_FIELD_PREP, FIELD_ENCODE,
> PACK_FIELD?
>
> Yeah I am struggling coming up with good names...
I'm not good either, but the above already are much more descriptive.
But I'd keep thre NVME prefix.
>
> Just for reference what v1 currently defines:
>
> #define NVME_GET(value, name) \
> (((value) >> NVME_##name##_SHIFT) & NVME_##name##_MASK)
I'd preferable avoid the magic naming pasting as well, and just pass
in the shift and mask.
next prev parent reply other threads:[~2025-10-13 6:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 11:07 libnvme API design Daniel Wagner
2025-10-10 7:26 ` Christoph Hellwig
2025-10-10 8:44 ` Daniel Wagner
2025-10-13 6:47 ` Christoph Hellwig [this message]
2025-10-13 13:02 ` Daniel Wagner
2025-10-13 14:22 ` Daniel Wagner
2025-10-14 4:20 ` Christoph Hellwig
2025-10-14 15:29 ` Daniel Wagner
2025-10-15 4:11 ` Christoph Hellwig
2025-10-14 4:20 ` 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:
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=20251013064700.GA2140@lst.de \
--to=hch@lst.de \
--cc=dwagner@suse.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
/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.