From: David Laight <david.laight.linux@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] container_of: Document container_of() is not to be used in new code
Date: Sat, 24 May 2025 13:45:26 +0100 [thread overview]
Message-ID: <20250524134526.28285a0b@pumpkin> (raw)
In-Reply-To: <2025052306-childlike-operating-d9c7@gregkh>
On Fri, 23 May 2025 10:36:45 +0200
Greg Kroah-Hartman <gregkh@linuxfoundation.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@linuxfoundation.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
next prev parent reply other threads:[~2025-05-24 12:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 10:34 [PATCH 1/1] container_of: Document container_of() is not to be used in new code Sakari Ailus
2025-05-20 14:16 ` Andy Shevchenko
2025-05-20 14:30 ` Greg Kroah-Hartman
2025-05-20 22:09 ` Sakari Ailus
2025-05-21 13:27 ` Greg Kroah-Hartman
2025-05-21 13:31 ` Greg Kroah-Hartman
2025-05-21 13:43 ` Greg Kroah-Hartman
2025-05-22 13:47 ` Greg Kroah-Hartman
2025-05-22 21:01 ` David Laight
2025-05-23 8:36 ` Greg Kroah-Hartman
2025-05-24 12:45 ` David Laight [this message]
2025-05-24 15:06 ` Greg Kroah-Hartman
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=20250524134526.28285a0b@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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