[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250522220142.14876993@pumpkin>
Date: Thu, 22 May 2025 22:01:42 +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 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.
Then most code will just contain container_of() and be fine and
not need churning.
So you'd have container_of_deconst() which is the old container_of() code
and contain_of_const() that preserves constness.
Then container_of() which is compile time selectable (for now) between them.
Get one of the build bots to enable it and things will slowly get fixed.
David
Powered by blists - more mailing lists