[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1Zk1qrfzVOn/k87@paasikivi.fi.intel.com>
Date: Mon, 24 Oct 2022 10:11:34 +0000
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: David Laight <David.Laight@...lab.com>
Cc: 'Greg Kroah-Hartman' <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH 1/1] linux/container_of.h: Warn about loss of constness
Hi David,
On Mon, Oct 24, 2022 at 08:59:29AM +0000, David Laight wrote:
> From: Greg Kroah-Hartman
> > Sent: 24 October 2022 09:44
> ...
> > > + * WARNING: as container_of() casts the given struct to another, also the
> >
> > No need for "also" here (sorry for the grammar nit.)
> >
> > > + * possible const qualifier of @ptr is lost unless it is also specified in
> > > + * @type. This is not a problem if the containing object is not const. Use with
> > > + * care.
> >
> > I do not think these last two sentences you added here are needed
> > either.
>
> It is all TL;DR :-)
>
> Even just:
>
> NOTE: any const qualifier of @ptr is lost.
>
> Is probably more than enough.
Fine for me, but I'd prefer to keep the WARNING, making this:
WARNING: any const qualifier of @ptr is lost.
--
Sakari Ailus
Powered by blists - more mailing lists