From: Peter Zijlstra <peterz@infradead.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Waiman Long <longman@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>
Subject: Re: [PATCH v1 1/1] locking/rwsem: Mark inline helpers with __maybe_unused
Date: Mon, 9 Sep 2024 15:29:41 +0200 [thread overview]
Message-ID: <20240909132941.GE4723@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20240909115839.1022530-1-andriy.shevchenko@linux.intel.com>
On Mon, Sep 09, 2024 at 02:58:39PM +0300, Andy Shevchenko wrote:
> When one or more inline heplers are unused, it prevents kernel builds
> with clang, `make W=1` and CONFIG_WERROR=y:
>
> kernel/locking/rwsem.c:187:20: error: unused function 'is_rwsem_reader_owned' [-Werror,-Wunused-function]
> 187 | static inline bool is_rwsem_reader_owned(struct rw_semaphore *sem)
> | ^~~~~~~~~~~~~~~~~~~~~
> kernel/locking/rwsem.c:271:35: error: unused function 'rwsem_owner' [-Werror,-Wunused-function]
> 271 | static inline struct task_struct *rwsem_owner(struct rw_semaphore *sem)
> | ^~~~~~~~~~~
>
> Fix this by marking inline helpers with __maybe_unused.
>
> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> inline functions for W=1 build").
:-(
And now you're back to the exact situation that people tried to avoid.
The moment one of these functions goes unused it will no longer scream
about it.
I'm for reverting the above commit, that gets all static inline on the
same footing, it should not matter if code is from a header file or not.
next prev parent reply other threads:[~2024-09-09 13:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 11:58 [PATCH v1 1/1] locking/rwsem: Mark inline helpers with __maybe_unused Andy Shevchenko
2024-09-09 13:29 ` Peter Zijlstra [this message]
2024-09-09 13:57 ` Andy Shevchenko
2024-09-09 14:03 ` Peter Zijlstra
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=20240909132941.GE4723@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=boqun.feng@gmail.com \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=will@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