lkml.org 
[lkml]   [2026]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject
Date
Subject: [PATCH v2 0/5] lib: rework bitreverse

Cleanup bitreverse-related Kconfig dependency mechanism, and add new
GENERIC_BITREVERSE option to allow architectures to pick the generic
implementation as a fallback for the arch one.

Make RISCV to pick the generic implementation with the absence of ZBKB.

v1: https://lore.kernel.org/all/20260430211351.658193-1-ynorov@nvidia.com/
v2:
- don't protect headers with the corresponding configs (Arnd, Erik);
- make HAVE_ARCH_BITREVERSE conditional on BITREVERSE;
- make GENERIC_BITREVERSE tri-state (sashiko);
- re-implement GENERIC_BITREVERSE and it's relation to BITREVERSE and
HAVE_ARCH_BITREVERSE, thus taking over the authorship;
- RISCV: select GENERIC_BITREVERSE and HAVE_ARCH_BITREVERSE depending
on BITREVERSE;

Jinjie Ruan (2):
bitops: Define generic___bitrev8/16/32 for reuse
arch/riscv: Add bitrev.h file to support rev8 and brev8

Yury Norov (3):
arch: select HAVE_ARCH_BITREVERSE conditionally on BITREVERSE
lib/bitrev: Introduce GENERIC_BITREVERSE
MAINTAINERS: BITOPS: include bitrev.[ch]

MAINTAINERS | 2 ++
arch/arm/Kconfig | 2 +-
arch/arm64/Kconfig | 2 +-
arch/loongarch/Kconfig | 2 +-
arch/mips/Kconfig | 2 +-
arch/riscv/Kconfig | 2 ++
arch/riscv/include/asm/bitrev.h | 51 +++++++++++++++++++++++++++
include/asm-generic/bitops/__bitrev.h | 23 ++++++++++++
include/linux/bitrev.h | 20 +++--------
lib/Kconfig | 13 +++++++
lib/Makefile | 2 +-
lib/bitrev.c | 3 --
12 files changed, 100 insertions(+), 24 deletions(-)
create mode 100644 arch/riscv/include/asm/bitrev.h
create mode 100644 include/asm-generic/bitops/__bitrev.h

--
2.51.0


\
 
 \ /
  Last update: 2026-05-06 19:53    [W:0.072 / U:3.215 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog