From: Helge Deller <deller@gmx.de>
To: Finn Thain <fthain@linux-m68k.org>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-m68k@vger.kernel.org, linux-parisc@vger.kernel.org
Subject: Re: [RFC v4 2/5] parisc: Drop linux/kernel.h include from asm/bug.h header
Date: Sat, 8 Nov 2025 23:39:53 +0100 [thread overview]
Message-ID: <4e1ef54d-6a9e-4ff3-a8d7-241742c6d77c@gmx.de> (raw)
In-Reply-To: <c36756368f0ee942d5a995a603ce290eba06a5b6.1760999284.git.fthain@linux-m68k.org>
On 10/21/25 00:28, Finn Thain wrote:
> This patch series will add WARN_ON_ONCE() calls to the header file
> linux/instrumented.h. That requires including linux/bug.h,
> but doing so causes the following compiler error on parisc:
>
> In file included from ./include/linux/atomic/atomic-instrumented.h:17,
> from ./include/linux/atomic.h:82,
> from ./arch/parisc/include/asm/bitops.h:13,
> from ./include/linux/bitops.h:67,
> from ./include/linux/kernel.h:23,
> from ./arch/parisc/include/asm/bug.h:5,
> from ./include/linux/bug.h:5,
> from ./include/linux/page-flags.h:10,
> from kernel/bounds.c:10:
> ./include/linux/instrumented.h: In function 'instrument_atomic_alignment_check':
> ./include/linux/instrumented.h:69:9: error: implicit declaration of function 'WARN_ON_ONCE' [-Werror=implicit-function-declaration]
> 69 | WARN_ON_ONCE((unsigned long)v & (size - 1));
> | ^~~~~~~~~~~~
> cc1: some warnings being treated as errors
> make[3]: *** [scripts/Makefile.build:182: kernel/bounds.s] Error 1
>
> The problem is, asm/bug.h indirectly includes atomic-instrumented.h,
> which means a new cycle appeared in the graph of #includes. And because
> some headers in the cycle can't see all definitions, WARN_ON_ONCE()
> appears to be an undeclared function.
>
> This only happens on parisc and it's easy to fix. In the error
> message above, linux/kernel.h is included by asm/bug.h. But it's no
> longer needed there, so remove it.
>
> The comment about needing BUGFLAG_TAINT seems to be incorrect as of
> commit 19d436268dde ("debug: Add _ONCE() logic to report_bug()"). Also,
> a comment in linux/kernel.h strongly discourages its use here.
>
> Compile-tested only.
> ---
> arch/parisc/include/asm/bug.h | 2 --
> 1 file changed, 2 deletions(-)
Acked-by: Helge Deller <deller@gmx.de> # parisc
Thanks!
Helge
next prev parent reply other threads:[~2025-11-08 22:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 22:28 [RFC v4 0/5] Align atomic storage Finn Thain
2025-10-20 22:28 ` [RFC v4 1/5] bpf: Explicitly align bpf_res_spin_lock Finn Thain
2025-10-20 22:28 ` [RFC v4 5/5] atomic: Add option for weaker alignment check Finn Thain
2025-10-20 22:28 ` [RFC v4 2/5] parisc: Drop linux/kernel.h include from asm/bug.h header Finn Thain
2025-11-08 22:39 ` Helge Deller [this message]
2025-10-20 22:28 ` [RFC v4 3/5] atomic: Specify alignment for atomic_t and atomic64_t Finn Thain
2025-11-24 0:23 ` Daniel Palmer
2025-11-25 3:52 ` Finn Thain
2025-10-20 22:28 ` [RFC v4 4/5] atomic: Add alignment check to instrumented atomic operations Finn Thain
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=4e1ef54d-6a9e-4ff3-a8d7-241742c6d77c@gmx.de \
--to=deller@gmx.de \
--cc=fthain@linux-m68k.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=linux-parisc@vger.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
all inboxes | Powered by JetHome®