riscv: Avoid code duplication with generic bitops implementation
authorXiao Wang <xiao.w.wang@intel.com>
Sun, 12 Nov 2023 09:44:21 +0000 (17:44 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 25 Jan 2024 01:25:36 +0000 (17:25 -0800)
commitcb4ede926134a65bc3bf90ed58dace8451d7e759
tree1ae5694003cd1566bd5a460e80a16ab1f63c2688
parent05d450aabd7386246c5aafc341fe9febe5855967
riscv: Avoid code duplication with generic bitops implementation

There's code duplication between the fallback implementation for bitops
__ffs/__fls/ffs/fls API and the generic C implementation in
include/asm-generic/bitops/. To avoid this duplication, this patch renames
the generic C implementation by adding a "generic_" prefix to them, then we
can use these generic APIs as fallback.

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231112094421.4014931-1-xiao.w.wang@intel.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/bitops.h
include/asm-generic/bitops/__ffs.h
include/asm-generic/bitops/__fls.h
include/asm-generic/bitops/ffs.h
include/asm-generic/bitops/fls.h