Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bitops: protect find_first_{,zero}_bit properly

find_first_bit() and find_first_zero_bit() are not protected with
ifdefs as other functions in find.h. It causes build errors on some
platforms if CONFIG_GENERIC_FIND_FIRST_BIT is enabled.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Fixes: 2cc7b6a44ac2 ("lib: add fast path for find_first_*_bit() and find_last_bit()")
Reported-by: kernel test robot <lkp@intel.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

+5
+5
include/asm-generic/bitops/find.h
··· 97 97 98 98 #ifdef CONFIG_GENERIC_FIND_FIRST_BIT 99 99 100 + #ifndef find_first_bit 100 101 /** 101 102 * find_first_bit - find the first set bit in a memory region 102 103 * @addr: The address to start the search at ··· 117 116 118 117 return _find_first_bit(addr, size); 119 118 } 119 + #endif 120 120 121 + #ifndef find_first_zero_bit 121 122 /** 122 123 * find_first_zero_bit - find the first cleared bit in a memory region 123 124 * @addr: The address to start the search at ··· 139 136 140 137 return _find_first_zero_bit(addr, size); 141 138 } 139 + #endif 140 + 142 141 #else /* CONFIG_GENERIC_FIND_FIRST_BIT */ 143 142 144 143 #ifndef find_first_bit