From: Jens Axboe <axboe@kernel.dk>
To: Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
linux-nvme@lists.infradead.org, sagi@grimberg.me
Subject: Re: [PATCH] nvme: add comment to not use kobj_to_dev()
Date: Mon, 21 Jun 2021 10:19:20 -0600 [thread overview]
Message-ID: <9ca39a1d-2b66-9a4c-fee0-960ab858b9c2@kernel.dk> (raw)
In-Reply-To: <20210621161743.GB1268033@dhcp-10-100-145-180.wdc.com>
On 6/21/21 10:17 AM, Keith Busch wrote:
> On Mon, Jun 21, 2021 at 07:32:51AM +0200, Christoph Hellwig wrote:
>> On Sun, Jun 20, 2021 at 08:09:40PM -0700, Chaitanya Kulkarni wrote:
>>> Add a comment in nvme_ns_id_attrs_are_visible() and
>>> nvme_dev_attrs_are_visible() not to replace container_of() with
>>> kobj_to_dev(). Since use of kobj_to_dev() makes code harder to read.
>>>
>>> Suggested-by: Keith Busch <kbusch@kernel.org>
>>> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
>>
>> Err, no. This code is completely obvious as is, and if people keep
>> sending these stupid patches we need to start blacklisting them.
>
> People will continue to send these patches as long as
> scripts/coccinelle/api/kobj_to_dev.cocci keeps warning about it.
How about we remove that rule then? FWIW, I totally agree with
conversions like this being harmful, container_of() is perfectly
readable, and the kobj_to_dev() is one of those things you always have
to cscope in to see wtf it is.
--
Jens Axboe
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-06-21 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 3:09 [PATCH] nvme: add comment to not use kobj_to_dev() Chaitanya Kulkarni
2021-06-21 5:32 ` Christoph Hellwig
2021-06-21 16:17 ` Keith Busch
2021-06-21 16:19 ` Jens Axboe [this message]
2021-06-21 16: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=9ca39a1d-2b66-9a4c-fee0-960ab858b9c2@kernel.dk \
--to=axboe@kernel.dk \
--cc=chaitanya.kulkarni@wdc.com \
--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