tree: https://github.com/norov/linux fns head: 15f7ffc3e9c1d0388c86efdb29d9a2c32aac0697 commit: a59b3e90bb16de4e813c83e6481731bba0309cfa [13/15] find_next_bit_wrap config: um-i386_defconfig compiler: gcc-11 (Debian 11.3.0-3) 11.3.0 reproduce (this is a W=1 build): # https://github.com/norov/linux/commit/a59b3e90bb16de4e813c83e6481731bba0309cfa git remote add norov https://github.com/norov/linux git fetch --no-tags norov fns git checkout a59b3e90bb16de4e813c83e6481731bba0309cfa # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=um SUBARCH=i386 prepare If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All errors (new ones prefixed by >>): arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes] 17 | void foo(void) | ^~~ In file included from include/linux/bitmap.h:9, from include/linux/cpumask.h:12, from include/linux/smp.h:13, from include/linux/lockdep.h:14, from include/linux/rcupdate.h:29, from include/linux/rculist.h:11, from include/linux/pid.h:5, from include/linux/sched.h:14, from arch/x86/um/shared/sysdep/kernel-offsets.h:3, from arch/um/kernel/asm-offsets.c:1: include/linux/find.h: In function 'find_next_bit_wrap': >> include/linux/find.h:35:24: error: implicit declaration of function 'find_next_bit'; did you mean '_find_next_bit'? [-Werror=implicit-function-declaration] 35 | from = find_next_bit(addr, to, from); | ^~~~~~~~~~~~~ | _find_next_bit >> include/linux/find.h:43:16: error: implicit declaration of function 'find_first_bit'; did you mean '_find_first_bit'? [-Werror=implicit-function-declaration] 43 | from = find_first_bit(addr, to); | ^~~~~~~~~~~~~~ | _find_first_bit include/linux/find.h: At top level: >> include/linux/find.h:58:15: error: conflicting types for 'find_next_bit'; have 'long unsigned int(const long unsigned int *, long unsigned int, long unsigned int)' 58 | unsigned long find_next_bit(const unsigned long *addr, unsigned long size, | ^~~~~~~~~~~~~ include/linux/find.h:35:24: note: previous implicit declaration of 'find_next_bit' with type 'int()' 35 | from = find_next_bit(addr, to, from); | ^~~~~~~~~~~~~ >> include/linux/find.h:143:15: error: conflicting types for 'find_first_bit'; have 'long unsigned int(const long unsigned int *, long unsigned int)' 143 | unsigned long find_first_bit(const unsigned long *addr, unsigned long size) | ^~~~~~~~~~~~~~ include/linux/find.h:43:16: note: previous implicit declaration of 'find_first_bit' with type 'int()' 43 | from = find_first_bit(addr, to); | ^~~~~~~~~~~~~~ In file included from include/linux/sched.h:22, from arch/x86/um/shared/sysdep/kernel-offsets.h:3, from arch/um/kernel/asm-offsets.c:1: include/linux/nodemask.h: In function '__next_node_in': >> include/linux/nodemask.h:281:61: error: 'n' undeclared (first use in this function) 281 | return find_next_bit_wrap(srcp->bits, MAX_NUMNODES, n+1, n+1); | ^ include/linux/nodemask.h:281:61: note: each undeclared identifier is reported only once for each function it appears in In file included from arch/um/kernel/asm-offsets.c:1: arch/x86/um/shared/sysdep/kernel-offsets.h: At top level: arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for 'foo' [-Wmissing-prototypes] 9 | void foo(void) | ^~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:117: arch/um/kernel/asm-offsets.s] Error 1 make[2]: Target '__build' not remade because of errors. make[1]: *** [Makefile:1200: prepare0] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [Makefile:219: __sub-make] Error 2 make: Target 'prepare' not remade because of errors. vim +35 include/linux/find.h 20 21 /** 22 * find_next_bit_wrap - find the next set bit in a memory region 23 * @addr: The address to base the search on 24 * @size: The bitmap size in bits 25 * @offset: The bitnumber to start searching at 26 * 27 * Returns the bit number for the next set bit 28 * If no bits are set, returns @size. 29 */ 30 static inline 31 unsigned long find_next_bit_wrap(const unsigned long *addr, unsigned long size, 32 unsigned long from, unsigned long to) 33 { 34 if (from < to) { > 35 from = find_next_bit(addr, to, from); 36 return from < to ? from : size; 37 } 38 39 from = find_next_bit(addr, size, from); 40 if (from < size) 41 return from; 42 > 43 from = find_first_bit(addr, to); 44 return from < to ? from : size; 45 } 46 47 #ifndef find_next_bit 48 /** 49 * find_next_bit - find the next set bit in a memory region 50 * @addr: The address to base the search on 51 * @size: The bitmap size in bits 52 * @offset: The bitnumber to start searching at 53 * 54 * Returns the bit number for the next set bit 55 * If no bits are set, returns @size. 56 */ 57 static inline > 58 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 59 unsigned long offset) 60 { 61 if (small_const_nbits(size)) { 62 unsigned long val; 63 64 if (unlikely(offset >= size)) 65 return size; 66 67 val = *addr & GENMASK(size - 1, offset); 68 return val ? __ffs(val) : size; 69 } 70 71 return _find_next_bit(addr, NULL, size, offset, 0UL, 0); 72 } 73 #endif 74 75 #ifndef find_next_and_bit 76 /** 77 * find_next_and_bit - find the next set bit in both memory regions 78 * @addr1: The first address to base the search on 79 * @addr2: The second address to base the search on 80 * @size: The bitmap size in bits 81 * @offset: The bitnumber to start searching at 82 * 83 * Returns the bit number for the next set bit 84 * If no bits are set, returns @size. 85 */ 86 static inline 87 unsigned long find_next_and_bit(const unsigned long *addr1, 88 const unsigned long *addr2, unsigned long size, 89 unsigned long offset) 90 { 91 if (small_const_nbits(size)) { 92 unsigned long val; 93 94 if (unlikely(offset >= size)) 95 return size; 96 97 val = *addr1 & *addr2 & GENMASK(size - 1, offset); 98 return val ? __ffs(val) : size; 99 } 100 101 return _find_next_bit(addr1, addr2, size, offset, 0UL, 0); 102 } 103 #endif 104 105 #ifndef find_next_zero_bit 106 /** 107 * find_next_zero_bit - find the next cleared bit in a memory region 108 * @addr: The address to base the search on 109 * @size: The bitmap size in bits 110 * @offset: The bitnumber to start searching at 111 * 112 * Returns the bit number of the next zero bit 113 * If no bits are zero, returns @size. 114 */ 115 static inline 116 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, 117 unsigned long offset) 118 { 119 if (small_const_nbits(size)) { 120 unsigned long val; 121 122 if (unlikely(offset >= size)) 123 return size; 124 125 val = *addr | ~GENMASK(size - 1, offset); 126 return val == ~0UL ? size : ffz(val); 127 } 128 129 return _find_next_bit(addr, NULL, size, offset, ~0UL, 0); 130 } 131 #endif 132 133 #ifndef find_first_bit 134 /** 135 * find_first_bit - find the first set bit in a memory region 136 * @addr: The address to start the search at 137 * @size: The maximum number of bits to search 138 * 139 * Returns the bit number of the first set bit. 140 * If no bits are set, returns @size. 141 */ 142 static inline > 143 unsigned long find_first_bit(const unsigned long *addr, unsigned long size) 144 { 145 if (small_const_nbits(size)) { 146 unsigned long val = *addr & GENMASK(size - 1, 0); 147 148 return val ? __ffs(val) : size; 149 } 150 151 return _find_first_bit(addr, size); 152 } 153 #endif 154 -- 0-DAY CI Kernel Test Service https://01.org/lkp