[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250524134526.28285a0b@pumpkin>
Date: Sat, 24 May 2025 13:45:26 +0100
From: David Laight <david.laight.linux@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] container_of: Document container_of() is not to be
used in new code
On Fri, 23 May 2025 10:36:45 +0200
Greg Kroah-Hartman <gregkh@...uxfoundation.org> wrote:
> On Thu, May 22, 2025 at 10:01:42PM +0100, David Laight wrote:
> > On Wed, 21 May 2025 15:31:36 +0200
> > Greg Kroah-Hartman <gregkh@...uxfoundation.org> wrote:
> >
> > > On Wed, May 21, 2025 at 03:27:19PM +0200, Greg Kroah-Hartman wrote:
> > ...
> > > I tried it for the whole tree, and ugh, there are some real "errors" in
> > > there. The nfs inode handling logic is crazy, passing in a const
> > > pointer and then setting fields in it. So this will be some real work
> > > to unwind and fix in some places.
> >
> > Perhaps change the really dodgy ones to container_of_deconst().
> > And fix the easy ones so they compile with the 'const' check.
>
> Ick, no, let me fix these up properly. I'm picking them off, and have
> found some real issues here. It will give me something to build patches
> for over time while doing stable kernel test builds :)
I was mostly thinking of it as temporary measure help find the easy cases.
But having container_of_const() that preserves 'const-ness' and
container_of() that always removes it seems wrong.
Wouldn't preserving const-ness for a W=1 build would be a more normal way
to do it?
David
Powered by blists - more mailing lists