From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: cgel.zte@gmail.com, kbusch@kernel.org, axboe@fb.com, hch@lst.de,
sagi@grimberg.me, linux-nvme@lists.infradead.org,
ye xingchen <ye.xingchen@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] nvme:Use the function kobj_to_dev()
Date: Thu, 11 Aug 2022 07:59:51 +0200 [thread overview]
Message-ID: <20220811055951.GA12417@lst.de> (raw)
In-Reply-To: <fd6af173-4530-5bb3-db61-6612e5d574bb@kernel.dk>
On Wed, Aug 10, 2022 at 07:32:40PM -0600, Jens Axboe wrote:
> > Use kobj_to_dev() instead of open-coding it.
>
> This:
>
> > - struct device *dev = container_of(kobj, struct device, kobj);
> > + struct device *dev = kobj_to_dev(kobj);
>
> just makes the code harder to read, imho. The original line, I can tell
> what it does. The new line, I have to go look it up.
Exactly.
> Is some tool suggesting these transformations? Because they look like a
> bad idea to me, and we should fix that rather than make the code worse.
I keeps coming up again and again and one of the maintainers always
answers something like you just did. Which suggests like someone or
something is unfortunately suggesting it.
prev parent reply other threads:[~2022-08-11 6:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 1:29 [PATCH linux-next] nvme:Use the function kobj_to_dev() cgel.zte
2022-08-11 1:32 ` Jens Axboe
2022-08-11 5:59 ` Christoph Hellwig [this message]
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=20220811055951.GA12417@lst.de \
--to=hch@lst.de \
--cc=axboe@fb.com \
--cc=axboe@kernel.dk \
--cc=cgel.zte@gmail.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=ye.xingchen@zte.com.cn \
--cc=zealci@zte.com.cn \
/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