[PATCH] m68k/bitops: Always include <asm-generic/bitops/find.h>

From: Geert Uytterhoeven
Date: Wed Dec 06 2017 - 05:40:27 EST


Currently <asm/bitops.h> only includes <asm-generic/bitops/find.h> if
CONFIG_CPU_HAS_NO_BITFIELDS=y. This used to be fine, as the code for
CONFIG_CPU_HAS_NO_BITFIELDS=n implemented everything provided by
<asm-generic/bitops/find.h>.

However, commit e49c614e6b37254b ("lib: optimize cpumask_next_and()")
added find_next_and_bit(), which is now not available if
CONFIG_CPU_HAS_NO_BITFIELDS=y:

lib/find_bit_benchmark.c: In function âtest_find_next_and_bitâ:
lib/find_bit_benchmark.c:115: error: implicit declaration of function âfind_next_and_bitâ

Move the inclusion of <asm-generic/bitops/find.h> outside the #ifdef to
fix this.

Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
arch/m68k/include/asm/bitops.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h
index dda58cfe8c22a3ec..93b47b1f6fb420a1 100644
--- a/arch/m68k/include/asm/bitops.h
+++ b/arch/m68k/include/asm/bitops.h
@@ -311,7 +311,6 @@ static inline int bfchg_mem_test_and_change_bit(int nr,
* functions.
*/
#if defined(CONFIG_CPU_HAS_NO_BITFIELDS)
-#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/ffz.h>
#else

@@ -441,6 +440,8 @@ static inline unsigned long ffz(unsigned long word)

#endif

+#include <asm-generic/bitops/find.h>
+
#ifdef __KERNEL__

#if defined(CONFIG_CPU_HAS_NO_BITFIELDS)
--
2.7.4