include: move find.h from asm_generic to linux

find_bit API and bitmap API are closely related, but inclusion paths
are different - include/asm-generic and include/linux, correspondingly.
In the past it made a lot of troubles due to circular dependencies
and/or undefined symbols. Fix this by moving find.h under include/linux.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
Yury Norov 2021-08-14 14:16:59 -07:00
parent 6b8ecb84f8
commit 47d8c15615
24 changed files with 11 additions and 31 deletions

View File

@ -3359,8 +3359,8 @@ M: Yury Norov <yury.norov@gmail.com>
R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
R: Rasmus Villemoes <linux@rasmusvillemoes.dk> R: Rasmus Villemoes <linux@rasmusvillemoes.dk>
S: Maintained S: Maintained
F: include/asm-generic/bitops/find.h
F: include/linux/bitmap.h F: include/linux/bitmap.h
F: include/linux/find.h
F: lib/bitmap.c F: lib/bitmap.c
F: lib/find_bit.c F: lib/find_bit.c
F: lib/find_bit_benchmark.c F: lib/find_bit_benchmark.c

View File

@ -430,8 +430,6 @@ static inline unsigned int __arch_hweight8(unsigned int w)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <asm-generic/bitops/find.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
/* /*

View File

@ -189,7 +189,6 @@ static inline __attribute__ ((const)) unsigned long __ffs(unsigned long x)
#include <asm-generic/bitops/atomic.h> #include <asm-generic/bitops/atomic.h>
#include <asm-generic/bitops/non-atomic.h> #include <asm-generic/bitops/non-atomic.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic-setbit.h> #include <asm-generic/bitops/ext2-atomic-setbit.h>

View File

@ -264,7 +264,6 @@ static inline int find_next_bit_le(const void *p, int size, int offset)
#endif #endif
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>
/* /*

View File

@ -18,7 +18,6 @@
#include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>

View File

@ -59,7 +59,6 @@ static __always_inline unsigned long __fls(unsigned long x)
#include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
#ifndef _LINUX_BITOPS_H #ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly #error only <linux/bitops.h> can be included directly

View File

@ -168,7 +168,6 @@ static inline unsigned long __ffs(unsigned long word)
return result; return result;
} }
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/lock.h>

View File

@ -271,7 +271,6 @@ static inline unsigned long __fls(unsigned long word)
} }
#include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>

View File

@ -441,8 +441,6 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <asm-generic/bitops/find.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>

View File

@ -529,6 +529,4 @@ static inline int __fls(int x)
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <asm-generic/bitops/find.h>
#endif /* _M68K_BITOPS_H */ #endif /* _M68K_BITOPS_H */

View File

@ -446,7 +446,6 @@ static inline int ffs(int word)
} }
#include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/find.h>
#ifdef __KERNEL__ #ifdef __KERNEL__

View File

@ -30,7 +30,6 @@
#include <asm/bitops/fls.h> #include <asm/bitops/fls.h>
#include <asm/bitops/__fls.h> #include <asm/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
#ifndef _LINUX_BITOPS_H #ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly #error only <linux/bitops.h> can be included directly

View File

@ -203,7 +203,6 @@ static __inline__ int fls(unsigned int x)
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic-setbit.h> #include <asm-generic/bitops/ext2-atomic-setbit.h>

View File

@ -255,8 +255,6 @@ unsigned long __arch_hweight64(__u64 w);
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
#endif #endif
#include <asm-generic/bitops/find.h>
/* wrappers that deal with KASAN instrumentation */ /* wrappers that deal with KASAN instrumentation */
#include <asm-generic/bitops/instrumented-atomic.h> #include <asm-generic/bitops/instrumented-atomic.h>
#include <asm-generic/bitops/instrumented-lock.h> #include <asm-generic/bitops/instrumented-lock.h>

View File

@ -20,7 +20,6 @@
#include <asm-generic/bitops/fls.h> #include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h> #include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/ffs.h> #include <asm-generic/bitops/ffs.h>

View File

@ -387,7 +387,6 @@ static inline int fls(unsigned int word)
#endif /* CONFIG_HAVE_MARCH_Z9_109_FEATURES */ #endif /* CONFIG_HAVE_MARCH_Z9_109_FEATURES */
#include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>

View File

@ -68,6 +68,5 @@ static inline unsigned long __ffs(unsigned long word)
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/find.h>
#endif /* __ASM_SH_BITOPS_H */ #endif /* __ASM_SH_BITOPS_H */

View File

@ -100,7 +100,6 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h> #include <asm-generic/bitops/ext2-atomic.h>

View File

@ -52,8 +52,6 @@ unsigned int __arch_hweight8(unsigned int w);
#include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/lock.h>
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <asm-generic/bitops/find.h>
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>

View File

@ -380,8 +380,6 @@ static __always_inline int fls64(__u64 x)
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#endif #endif
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/sched.h>
#include <asm/arch_hweight.h> #include <asm/arch_hweight.h>

View File

@ -205,7 +205,6 @@ BIT_OPS(change, "xor", )
#undef BIT_OP #undef BIT_OP
#undef TEST_AND_BIT_OP #undef TEST_AND_BIT_OP
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/le.h> #include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic-setbit.h> #include <asm-generic/bitops/ext2-atomic-setbit.h>

View File

@ -20,7 +20,6 @@
#include <asm-generic/bitops/fls.h> #include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/__fls.h> #include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
#include <asm-generic/bitops/find.h>
#ifndef _LINUX_BITOPS_H #ifndef _LINUX_BITOPS_H
#error only <linux/bitops.h> can be included directly #error only <linux/bitops.h> can be included directly

View File

@ -6,6 +6,7 @@
#include <linux/align.h> #include <linux/align.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/find.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/types.h> #include <linux/types.h>

View File

@ -1,6 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_BITOPS_FIND_H_ #ifndef __LINUX_FIND_H_
#define _ASM_GENERIC_BITOPS_FIND_H_ #define __LINUX_FIND_H_
#ifndef __LINUX_BITMAP_H
#error only <linux/bitmap.h> can be included directly
#endif
#include <linux/bitops.h>
extern unsigned long _find_next_bit(const unsigned long *addr1, extern unsigned long _find_next_bit(const unsigned long *addr1,
const unsigned long *addr2, unsigned long nbits, const unsigned long *addr2, unsigned long nbits,
@ -259,4 +265,4 @@ unsigned long find_next_bit_le(const void *addr, unsigned
#error "Please fix <asm/byteorder.h>" #error "Please fix <asm/byteorder.h>"
#endif #endif
#endif /*_ASM_GENERIC_BITOPS_FIND_H_ */ #endif /*__LINUX_FIND_H_ */