From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <chaitanyak@nvidia.com>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: "kbusch@kernel.org" <kbusch@kernel.org>,
"axboe@kernel.dk" <axboe@kernel.dk>, "ch@lst.de" <ch@lst.de>
Subject: Re: [RFC PATCH] nvme-core: add helper to get nvme_ctrl from device
Date: Wed, 17 May 2023 07:55:46 +0000 [thread overview]
Message-ID: <4c52ac51-73fd-97c5-4bfc-7e897dc9e73a@nvidia.com> (raw)
In-Reply-To: <0b182e1b-e267-81da-dbda-95ea04ade338@grimberg.me>
Hi Sagi,
On 5/17/23 00:12, Sagi Grimberg wrote:
>
>> Just like we have other helpers to_nvmet_port(), to_nvmet_ns(),
>> ana_groups_to_port() and to_nvmet_ns(), add a helper to get nvme_ctr
>> from struct device.
>
> I don't think this is very useful.
it's the same pattern we have used everywhere in the nvme code,
I did not invent anything new here ...
>> Note that this removes the bunch of nvme_ctrl declaration code that is
>> needed to get the nvme_ctrl from struct device in the host/core.c.
>> Followwing is the diff :-
>
> It doesn't make it easier on my eyes...
>
I failed to understand how this is different from examples mentioned above
which are part of existing code reducing ~20 lines in current code and
future code for a variable declaration that is only accessed once ?
-ck
[1] diffstat:-
drivers/nvme/host/core.c | 69 +++++++++++++++-------------------------
1 file changed, 26 insertions(+), 43 deletions(-)
next prev parent reply other threads:[~2023-05-17 7:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 8:22 [RFC PATCH] nvme-core: add helper to get nvme_ctrl from device Chaitanya Kulkarni
2023-05-17 7:12 ` Sagi Grimberg
2023-05-17 7:55 ` Chaitanya Kulkarni [this message]
2023-05-17 10:45 ` Sagi Grimberg
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=4c52ac51-73fd-97c5-4bfc-7e897dc9e73a@nvidia.com \
--to=chaitanyak@nvidia.com \
--cc=axboe@kernel.dk \
--cc=ch@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;
as well as URLs for NNTP newsgroup(s).