From: Yury Norov <yury.norov@gmail.com>
To: Yunhui Cui <cuiyunhui@bytedance.com>
Cc: aou@eecs.berkeley.edu, alex@ghiti.fr, andii@kernel.org,
andybnac@gmail.com, apatel@ventanamicro.com, ast@kernel.org,
ben.dooks@codethink.co.uk, bjorn@kernel.org, bpf@vger.kernel.org,
charlie@rivosinc.com, cl@gentwo.org, conor.dooley@microchip.com,
cyrilbur@tenstorrent.com, daniel@iogearbox.net,
debug@rivosinc.com, dennis@kernel.org, eddyz87@gmail.com,
haoluo@google.com, john.fastabend@gmail.com, jolsa@kernel.org,
kpsingh@kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, linux-riscv@lists.infradead.org,
linux@rasmusvillemoes.dk, martin.lau@linux.dev,
palmer@dabbelt.com, pjw@kernel.org, puranjay@kernel.org,
pulehui@huawei.com, ruanjinjie@huawei.com,
rkrcmar@ventanamicro.com, samuel.holland@sifive.com,
sdf@fomichev.me, song@kernel.org, tglx@linutronix.de,
tj@kernel.org, thuth@redhat.com, yonghong.song@linux.dev,
zong.li@sifive.com
Subject: Re: [PATCH v3 1/3] riscv: remove irqflags.h inclusion in asm/bitops.h
Date: Tue, 16 Dec 2025 12:39:26 -0500 [thread overview]
Message-ID: <aUGZTkLGYuew7-s1@yury> (raw)
In-Reply-To: <20251216014721.42262-2-cuiyunhui@bytedance.com>
On Tue, Dec 16, 2025 at 09:47:19AM +0800, Yunhui Cui wrote:
> The arch/riscv/include/asm/bitops.h does not functionally require
> including /linux/irqflags.h. Additionally, adding
> arch/riscv/include/asm/percpu.h causes a circular inclusion:
> kernel/bounds.c
> ->include/linux/log2.h
> ->include/linux/bitops.h
> ->arch/riscv/include/asm/bitops.h
> ->include/linux/irqflags.h
> ->include/linux/find.h
> ->return val ? __ffs(val) : size;
> ->arch/riscv/include/asm/bitops.h
>
> The compilation log is as follows:
> CC kernel/bounds.s
> In file included from ./include/linux/bitmap.h:11,
> from ./include/linux/cpumask.h:12,
> from ./arch/riscv/include/asm/processor.h:55,
> from ./arch/riscv/include/asm/thread_info.h:42,
> from ./include/linux/thread_info.h:60,
> from ./include/asm-generic/preempt.h:5,
> from ./arch/riscv/include/generated/asm/preempt.h:1,
> from ./include/linux/preempt.h:79,
> from ./arch/riscv/include/asm/percpu.h:8,
> from ./include/linux/irqflags.h:19,
> from ./arch/riscv/include/asm/bitops.h:14,
> from ./include/linux/bitops.h:68,
> from ./include/linux/log2.h:12,
> from kernel/bounds.c:13:
> ./include/linux/find.h: In function 'find_next_bit':
> ./include/linux/find.h:66:30: error: implicit declaration of function '__ffs' [-Wimplicit-function-declaration]
> 66 | return val ? __ffs(val) : size;
> | ^~~~~
>
> Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
Acked-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
> ---
> arch/riscv/include/asm/bitops.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/riscv/include/asm/bitops.h b/arch/riscv/include/asm/bitops.h
> index 238092125c118..3c1a15be54d80 100644
> --- a/arch/riscv/include/asm/bitops.h
> +++ b/arch/riscv/include/asm/bitops.h
> @@ -11,7 +11,6 @@
> #endif /* _LINUX_BITOPS_H */
>
> #include <linux/compiler.h>
> -#include <linux/irqflags.h>
> #include <asm/barrier.h>
> #include <asm/bitsperlong.h>
>
> --
> 2.39.5
next prev parent reply other threads:[~2025-12-16 17:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 1:47 [PATCH v3 0/3] RISC-V: add percpu.h to include/asm Yunhui Cui
2025-12-16 1:47 ` [PATCH v3 1/3] riscv: remove irqflags.h inclusion in asm/bitops.h Yunhui Cui
2025-12-16 17:39 ` Yury Norov [this message]
2025-12-16 1:47 ` [PATCH v3 2/3] riscv: introduce percpu.h into include/asm Yunhui Cui
2025-12-20 14:45 ` kernel test robot
2025-12-20 16:31 ` kernel test robot
2025-12-16 1:47 ` [PATCH v3 3/3] riscv: store percpu offset into thread_info Yunhui Cui
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=aUGZTkLGYuew7-s1@yury \
--to=yury.norov@gmail.com \
--cc=alex@ghiti.fr \
--cc=andii@kernel.org \
--cc=andybnac@gmail.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=ast@kernel.org \
--cc=ben.dooks@codethink.co.uk \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=charlie@rivosinc.com \
--cc=cl@gentwo.org \
--cc=conor.dooley@microchip.com \
--cc=cuiyunhui@bytedance.com \
--cc=cyrilbur@tenstorrent.com \
--cc=daniel@iogearbox.net \
--cc=debug@rivosinc.com \
--cc=dennis@kernel.org \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@rasmusvillemoes.dk \
--cc=martin.lau@linux.dev \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=pulehui@huawei.com \
--cc=puranjay@kernel.org \
--cc=rkrcmar@ventanamicro.com \
--cc=ruanjinjie@huawei.com \
--cc=samuel.holland@sifive.com \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=tglx@linutronix.de \
--cc=thuth@redhat.com \
--cc=tj@kernel.org \
--cc=yonghong.song@linux.dev \
--cc=zong.li@sifive.com \
/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