public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, acme@kernel.org, namhyung@kernel.org,
	linux-kernel@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf/x86/uncore: clean up const mismatch
Date: Thu, 18 Dec 2025 10:59:25 +0100	[thread overview]
Message-ID: <2025121819-snowdrift-thievish-4108@gregkh> (raw)
In-Reply-To: <20251218085551.GK3707891@noisy.programming.kicks-ass.net>

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

  reply	other threads:[~2025-12-18  9:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-17 12:42 [PATCH] perf/x86/uncore: clean up const mismatch Greg Kroah-Hartman
2025-12-18  8:55 ` Peter Zijlstra
2025-12-18  9:59   ` Greg Kroah-Hartman [this message]
2025-12-18 10:11     ` Peter Zijlstra
2025-12-18 11:20       ` Greg Kroah-Hartman
2026-01-12  8:03 ` [tip: perf/core] " tip-bot2 for 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=2025121819-snowdrift-thievish-4108@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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