Re: [PATCH] linux/kernel.h: add container_from()
From: James Bottomley
Date: Thu Aug 27 2020 - 14:32:20 EST
On Thu, 2020-08-27 at 11:04 -0700, Linus Torvalds wrote:
> On Wed, Aug 26, 2020 at 6:36 PM Allen Pais <allen.lkml@xxxxxxxxx>
> wrote:
> >
> > Introduce container_from() as a generic helper instead of
> > sub-systems defining a private from_
>
> NAK.
>
> This seems completely broken.
>
> The documentation comment doesn't even match the macro, and claims
> that "container" is a type.
>
> Which it isn't. That's what container_of()" already takes.
>
> And if the argument is that a broken commit introduced a broken
> macro,
> then that's not a great argument. Yes, we have that broken
> "from_tasklet()" macro, but it's not even *USED* anywhere.
>
> So instead of adding a broken new concept that adds absolutely no
> value, let's just remove the broken macro that isn't even used.
The argument is more over the tasklet rework adding from_tasklet that
was effectively completely generic.
https://lore.kernel.org/dri-devel/20200817091617.28119-1-allen.cryptic@xxxxxxxxx/
The tasklet rework people don't want to use container_of, which was our
first suggestion, because it produces lines which are "too long". So
container_from is a compromise that takes the actual structure pointer
as a second argument instead of the structure type, thus being
completely generic and suitable for line length reduction in the
tasklet rework code.
James