]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arch: select HAVE_ARCH_BITREVERSE conditionally on BITREVERSE
authorYury Norov <ynorov@nvidia.com>
Wed, 6 May 2026 17:52:02 +0000 (13:52 -0400)
committerYury Norov <ynorov@nvidia.com>
Thu, 28 May 2026 15:39:16 +0000 (11:39 -0400)
Architectures may have bit reversal instructions, but if the API not
needed, the corresponding option should not be selected because it may
lead to generating the unneeded code.

Signed-off-by: Yury Norov <ynorov@nvidia.com>
arch/arm/Kconfig
arch/arm64/Kconfig
arch/loongarch/Kconfig
arch/mips/Kconfig
lib/Kconfig

index 71fc5dd4123f3c0eb0bd397cfbb4ed7474de6976..0e963e54fe06b1da60b75c03caf05a07664c0744 100644 (file)
@@ -83,7 +83,7 @@ config ARM
        select HARDIRQS_SW_RESEND
        select HAS_IOPORT
        select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT
-       select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
+       select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6 && BITREVERSE
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU && (!PREEMPT_RT || !SMP)
        select HAVE_ARCH_KFENCE if MMU && !XIP_KERNEL
        select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
index fe60738e5943ba279e5571862423df4fed3db661..f5bb62c2ba9c50c0dd5ddc1292f267654943e8b8 100644 (file)
@@ -150,7 +150,7 @@ config ARM64
        select HAVE_ACPI_APEI if (ACPI && EFI)
        select HAVE_ALIGNED_STRUCT_PAGE
        select HAVE_ARCH_AUDITSYSCALL
-       select HAVE_ARCH_BITREVERSE
+       select HAVE_ARCH_BITREVERSE if BITREVERSE
        select HAVE_ARCH_COMPILER_H
        select HAVE_ARCH_HUGE_VMALLOC
        select HAVE_ARCH_HUGE_VMAP
index 606597da46b8df3407bbd60d73f1df44f19bdd40..d6e1c8a734afc5b853ecec98b3beae16f6863445 100644 (file)
@@ -115,7 +115,7 @@ config LOONGARCH
        select HAS_IOPORT
        select HAVE_ALIGNED_STRUCT_PAGE if 64BIT
        select HAVE_ARCH_AUDITSYSCALL
-       select HAVE_ARCH_BITREVERSE if 64BIT
+       select HAVE_ARCH_BITREVERSE if 64BIT && BITREVERSE
        select HAVE_ARCH_JUMP_LABEL
        select HAVE_ARCH_JUMP_LABEL_RELATIVE
        select HAVE_ARCH_KASAN if 64BIT
index 4364f3dba688fed141ccb463247075bf6a547cbc..7e1494e0dbfa4620e2b63188af95920d3a1edfe4 100644 (file)
@@ -2026,7 +2026,7 @@ config CPU_MIPSR6
        default y if CPU_MIPS32_R6 || CPU_MIPS64_R6
        select CPU_HAS_RIXI
        select CPU_HAS_DIEI if !CPU_DIEI_BROKEN
-       select HAVE_ARCH_BITREVERSE
+       select HAVE_ARCH_BITREVERSE if BITREVERSE
        select MIPS_ASID_BITS_VARIABLE
        select MIPS_SPRAM
 
index 00a9509636c18736f6468bc754c126d2de1927b6..d8e7e89ae32059b790120ff0d6816e58def8c2b3 100644 (file)
@@ -58,6 +58,7 @@ config BITREVERSE
 config HAVE_ARCH_BITREVERSE
        bool
        default n
+       depends on BITREVERSE
        help
          This option enables the use of hardware bit-reversal instructions on
          architectures which support such operations.