sbitmap: simplify __sbitmap_for_each_set()
PATCH 1/1 sbitmap: simplify __sbitmap_for_each_set()
From: Yury Norov (NVIDIA) <[email protected]>
The function opencodes for_each_set_bit_from(). Fix that and drop most of the housekeeping code.
Signed-off-by Yury Norov (NVIDIA) <[email protected]>
--- include/linux/sbitmap.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
include/linux/sbitmap.h +1 -7
@@ -279,15 +279,9 @@ static inline void __sbitmap_for_each_set(struct sbitmap *sb,* On all other iterations, nr is zero, so this is a noop. */ depth += nr; -while (1 ) { - nr =find_next_bit (&word, depth, nr); -if (nr >= depth) -break ; +for_each_set_bit_from (nr, &word, depth)if (!fn (sb, (index << sb->shift) + nr, data))return ; - - nr++; - } next: nr =0 ;if (++index >= sb->map_nr)
Signature · 1 line
2.43.0