public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>
To: David Laight <David.Laight@aculab.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH v2] driver core: allow kobj_to_dev() to take a const pointer
Date: Mon, 17 Oct 2022 13:32:33 +0200	[thread overview]
Message-ID: <Y009UQUfn4m/1IET@kroah.com> (raw)
In-Reply-To: <b13c5bb641d64433a85c52f694a838e7@AcuMS.aculab.com>

On Mon, Oct 17, 2022 at 11:24:26AM +0000, David Laight wrote:
> From: Greg Kroah-Hartman
> > Sent: 17 October 2022 09:04
> > 
> > On Mon, Oct 17, 2022 at 07:54:52AM +0000, Sakari Ailus wrote:
> > > Hi Greg,
> > >
> > > On Sun, Oct 16, 2022 at 12:41:26PM +0200, Greg Kroah-Hartman wrote:
> > > > If a const * to a kobject is passed to kobj_to_dev(), we want to return
> > > > back a const * to a device as the driver core shouldn't be modifying a
> > > > constant structure.  But when dealing with container_of() the pointer
> > > > const attribute is cast away, so we need to manually handle this by
> > > > determining the type of the pointer passed in to know the type of the
> > > > pointer to pass out.
> > >
> > > Alternatively container_of() could be fixed, but that will likely produce
> > > lots of warnings currently.
> > 
> > Yeah, we can not do that because, as you found out, there's just too
> > many warnings that it would cause.  Let's work on the individual
> > subsystems to clean them all up first before worrying about the core
> > container_of() macro as that should fix the majority of the build
> > warnings.
> 
> Is it possible to generate a fixed container_of() with a
> different name and then use that to clean up the subsystems?
> Then finally rename it back?
> 
> That you probably be a lot less churn.

That's the identical churn.

  reply	other threads:[~2022-10-17 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 10:41 [PATCH v2] driver core: allow kobj_to_dev() to take a const pointer Greg Kroah-Hartman
2022-10-17  7:54 ` Sakari Ailus
2022-10-17  8:04   ` Greg Kroah-Hartman
2022-10-17  9:39     ` Sakari Ailus
2022-10-17 11:24     ` David Laight
2022-10-17 11:32       ` 'Greg Kroah-Hartman' [this message]
2022-10-17  9:24 ` Andy Shevchenko

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=Y009UQUfn4m/1IET@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=David.Laight@aculab.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@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