BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yury Norov" <ynorov@nvidia.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v2 4/5] arch/riscv: Add bitrev.h file to support rev8 and brev8
Date: Wed, 06 May 2026 22:23:25 +0000	[thread overview]
Message-ID: <20260506222325.920DAC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260506175207.110893-5-ynorov@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Selecting GENERIC_BITREVERSE conditionally on HAVE_ARCH_BITREVERSE causes a Kconfig unmet direct dependency warning when BITREVERSE is built as a module.
--

commit 500623b90fe7e30bdea603dfb1e1f54158143ee4
Author: Jinjie Ruan <ruanjinjie@huawei.com>

arch/riscv: Add bitrev.h file to support rev8 and brev8

This commit utilizes the RISC-V Zbkb brev8 and rev8 instructions to
efficiently implement bit reversal. It conditionally selects
HAVE_ARCH_BITREVERSE and GENERIC_BITREVERSE when the extension is available.

Link: https://docs.riscv.org/reference/isa/unpriv/b-st-ext.html

> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index d235396c45141..a708583f785db 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -104,6 +104,7 @@ config RISCV
>  	select FUNCTION_ALIGNMENT_8B if DYNAMIC_FTRACE_WITH_CALL_OPS
>  	select GENERIC_ARCH_TOPOLOGY
>  	select GENERIC_ATOMIC64 if !64BIT
> +	select GENERIC_BITREVERSE if HAVE_ARCH_BITREVERSE

Will this cause an unmet direct dependency warning if BITREVERSE is built
as a module?

In lib/Kconfig, GENERIC_BITREVERSE is a tristate symbol that has a dependency
on BITREVERSE. Because HAVE_ARCH_BITREVERSE is a boolean symbol, if BITREVERSE
is configured as a module (=m), the condition for HAVE_ARCH_BITREVERSE below
evaluates to m but Kconfig automatically promotes it to y.

This forces GENERIC_BITREVERSE to y while its required dependency BITREVERSE
is only m.

Should this select also inherit the dependency (e.g., select
GENERIC_BITREVERSE if HAVE_ARCH_BITREVERSE && BITREVERSE) to cap the
selection strength and avoid the warning?

[ ... ]
> @@ -128,6 +129,7 @@ config RISCV
>  	select HAS_IOPORT if MMU
>  	select HAVE_ALIGNED_STRUCT_PAGE
>  	select HAVE_ARCH_AUDITSYSCALL
> +	select HAVE_ARCH_BITREVERSE if RISCV_ISA_ZBKB && BITREVERSE

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260506175207.110893-1-ynorov@nvidia.com?part=4

  reply	other threads:[~2026-05-06 22:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 17:52 Yury Norov
2026-05-06 17:52 ` [PATCH v2 1/5] arch: select HAVE_ARCH_BITREVERSE conditionally on BITREVERSE Yury Norov
2026-05-06 21:37   ` sashiko-bot
2026-05-06 17:52 ` [PATCH v2 2/5] lib/bitrev: Introduce GENERIC_BITREVERSE Yury Norov
2026-05-06 21:49   ` sashiko-bot
2026-05-06 17:52 ` [PATCH v2 3/5] bitops: Define generic___bitrev8/16/32 for reuse Yury Norov
2026-05-06 17:52 ` [PATCH v2 4/5] arch/riscv: Add bitrev.h file to support rev8 and brev8 Yury Norov
2026-05-06 22:23   ` sashiko-bot [this message]
2026-05-06 17:52 ` [PATCH v2 5/5] MAINTAINERS: BITOPS: include bitrev.[ch] Yury Norov

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=20260506222325.920DAC2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko@lists.linux.dev \
    --cc=ynorov@nvidia.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