lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813152142.GP4067720@noisy.programming.kicks-ass.net>
Date: Wed, 13 Aug 2025 17:21:42 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Dan Williams <dan.j.williams@...el.com>, dave.jiang@...el.com,
	linux-kernel@...r.kernel.org, linux-cxl@...r.kernel.org,
	Nathan Chancellor <nathan@...nel.org>,
	David Lechner <dlechner@...libre.com>,
	Jonathan Cameron <jonathan.cameron@...wei.com>,
	Andy Shevchenko <andriy.shevchenko@...el.com>
Subject: Re: [PATCH] cleanup: Fix unused guard error function with
 DEFINE_CLASS_IS_COND_GUARD

On Wed, Aug 13, 2025 at 08:14:59AM -0700, Linus Torvalds wrote:
> On Wed, 13 Aug 2025 at 07:13, Peter Zijlstra <peterz@...radead.org> wrote:
> >
> > On Mon, Aug 04, 2025 at 03:09:54PM -0700, Dan Williams wrote:
> > >
> > > ...with a clang W=1 build. Per Nathan, clang catches unused "static inline"
> > > functions in C files since commit 6863f5643dd7 ("kbuild: allow Clang to
> > > find unused static inline functions for W=1 build").
> >
> > I so loathe that warning :/
> 
> So I entirely ignore W=1 issues, because I think so many of the extra
> warnings are bogus.
> 
> But if this one in particular is causing more problems than most -
> some teams do seem to use W=1 as part of their test builds - it's fine
> to send me a patch that just moves bad warnings to W=2.
> 
> And if anybody uses W=2 for their test builds, that's THEIR problem..

Right, so I've had patches that added extra #ifdef gunk because of this,
and we've sprinked __maybe_unused in a few places just to shut this up.

I think something like the below will do... totally untested and all
that.

diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 16755431fc11..12b8b5d81459 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -253,7 +253,7 @@ struct ftrace_likely_data {
  * for W=1 build. This will allow clang to find unused functions. Remove the
  * __inline_maybe_unused entirely after fixing most of -Wunused-function warnings.
  */
-#ifdef KBUILD_EXTRA_WARN1
+#ifdef KBUILD_EXTRA_WARN2
 #define __inline_maybe_unused
 #else
 #define __inline_maybe_unused __maybe_unused

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ