[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025121819-snowdrift-thievish-4108@gregkh>
Date: Thu, 18 Dec 2025 10:59:25 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: mingo@...hat.com, acme@...nel.org, namhyung@...nel.org,
linux-kernel@...r.kernel.org, Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH] perf/x86/uncore: clean up const mismatch
On Thu, Dec 18, 2025 at 09:55:51AM +0100, Peter Zijlstra wrote:
> On Wed, Dec 17, 2025 at 01:42:41PM +0100, Greg Kroah-Hartman wrote:
> > In some cmp functions, a const pointer is cast out to a non-const
> > pointer by using container_of() which is not correct. Fix this up by
> > properly marking the pointers as const, which preserves the correct
> > type of the pointer passed into the functions.
>
> How did you find this? My builds do not complain and all that.
I have a local change that turns container_of() into container_of_const():
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=container_of_const_mess&id=ea8cab3db2b5a56c5ef63d0e32accce58eb9bb2c
that I'm using to sweep the tree and fix up all of the places we have
gotten this wrong. And wow, have we gotten it wrong in so many
places...
It's a slow grind, I'll get there eventually and then will merge a patch
that forces container_of() to catch this type of thing so it will not
come back in the future. Maybe a year or so, no real rush :)
thanks,
greg k-h
Powered by blists - more mailing lists