Thread (5 messages) 5 messages, 4 authors, 2021-06-21

Re: [PATCH] nvme: add comment to not use kobj_to_dev()

From: Jens Axboe <axboe@kernel.dk>
Date: 2021-06-21 16:19:44

On 6/21/21 10:17 AM, Keith Busch wrote:
On Mon, Jun 21, 2021 at 07:32:51AM +0200, Christoph Hellwig wrote:
quoted
On Sun, Jun 20, 2021 at 08:09:40PM -0700, Chaitanya Kulkarni wrote:
quoted
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 <redacted>
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help