Skip to contentSkip to conversation

bitops: Remove code related to for_each_set_clump8

PATCH Superseded Syed Nayyar Waris 1 participant 1 message Apr 24, 2020

Subsystems (4)

v1 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 bitops: Remove code related to for_each_set_clump8

Remove code related to the old for_each_set_clump8 macro because it has now been replaced by the new generic for_each_set_clump macro.

---
 include/asm-generic/bitops/find.h | 17 ----------
 include/linux/bitmap.h            | 35 ---------------------
 include/linux/bitops.h            | 12 --------
 lib/find_bit.c                    | 14 ---------
 lib/test_bitmap.c                 | 65 ---------------------------------------
 5 files changed, 143 deletions(-)
include/asm-generic/bitops/find.h +0 -17
index 4e66007..d412268 100644
@@ -81,23 +81,6 @@ extern unsigned long find_first_zero_bit(const unsigned long *addr,
 #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */
 
 /**
- * find_next_clump8 - find next 8-bit clump with set bits in a memory region
- * @clump: location to store copy of found clump
- * @addr: address to base the search on
- * @size: bitmap size in number of bits
- * @offset: bit offset at which to start searching
- *
- * Returns the bit offset for the next set clump; the found clump value is
- * copied to the location pointed by @clump. If no bits are set, returns @size.
- */
-extern unsigned long find_next_clump8(unsigned long *clump,
-				      const unsigned long *addr,
-				      unsigned long size, unsigned long offset);
-
-#define find_first_clump8(clump, bits, size) \
-	find_next_clump8((clump), (bits), (size), 0)
-
-/**
  * find_next_clump - find next clump with set bits in a memory region
  * @clump: location to store copy of found clump
  * @addr: address to base the search on
include/linux/bitmap.h +0 -35
index 7ab2c65..d6595bc1 100644
@@ -74,10 +74,8 @@
  *  bitmap_allocate_region(bitmap, pos, order)  Allocate specified bit region
  *  bitmap_from_arr32(dst, buf, nbits)          Copy nbits from u32[] buf to dst
  *  bitmap_to_arr32(buf, src, nbits)            Copy nbits from buf to u32[] dst
- *  bitmap_get_value8(map, start)               Get 8bit value from map at start
  *  bitmap_get_value(map, start, nbits)		Get bit value of size
  *						'nbits' from map at start
- *  bitmap_set_value8(map, value, start)        Set 8bit value to map at start
  *  bitmap_set_value(map, value, start, nbits)	Set bit value of size 'nbits'
  *						of map at start
  *
@@ -551,23 +549,6 @@ static inline void bitmap_from_u64(unsigned long *dst, u64 mask)
 }
 
 /**
- * bitmap_get_value8 - get an 8-bit value within a memory region
- * @map: address to the bitmap memory region
- * @start: bit offset of the 8-bit value; must be a multiple of 8
- *
- * Returns the 8-bit value located at the @start bit offset within the @src
- * memory region.
- */
-static inline unsigned long bitmap_get_value8(const unsigned long *map,
-					      unsigned long start)
-{
-	const size_t index = BIT_WORD(start);
-	const unsigned long offset = start % BITS_PER_LONG;
-
-	return (map[index] >> offset) & 0xFF;
-}
-
-/**
  * bitmap_get_value - get a value of n-bits from the memory region
  * @map: address to the bitmap memory region
  * @start: bit offset of the n-bit value
@@ -596,22 +577,6 @@ static inline unsigned long bitmap_get_value(const unsigned long *map,
 }
 
 /**
- * bitmap_set_value8 - set an 8-bit value within a memory region
- * @map: address to the bitmap memory region
- * @value: the 8-bit value; values wider than 8 bits may clobber bitmap
- * @start: bit offset of the 8-bit value; must be a multiple of 8
- */
-static inline void bitmap_set_value8(unsigned long *map, unsigned long value,
-				     unsigned long start)
-{
-	const size_t index = BIT_WORD(start);
-	const unsigned long offset = start % BITS_PER_LONG;
-
-	map[index] &= ~(0xFFUL << offset);
-	map[index] |= value << offset;
-}
-
-/**
  * bitmap_set_value - set n-bit value within a memory region
  * @map: address to the bitmap memory region
  * @value: value of nbits
include/linux/bitops.h +0 -12
index 41c2d9c..cc0a413 100644
@@ -51,18 +51,6 @@ extern unsigned long __sw_hweight64(__u64 w);
 	     (bit) = find_next_zero_bit((addr), (size), (bit) + 1))
 
 /**
- * for_each_set_clump8 - iterate over bitmap for each 8-bit clump with set bits
- * @start: bit offset to start search and to store the current iteration offset
- * @clump: location to store copy of current 8-bit clump
- * @bits: bitmap address to base the search on
- * @size: bitmap size in number of bits
- */
-#define for_each_set_clump8(start, clump, bits, size) \
-	for ((start) = find_first_clump8(&(clump), (bits), (size)); \
-	     (start) < (size); \
-	     (start) = find_next_clump8(&(clump), (bits), (size), (start) + 8))
-
-/**
  * for_each_set_clump - iterate over bitmap for each clump with set bits
  * @start: bit offset to start search and to store the current iteration offset
  * @clump: location to store copy of current 8-bit clump
lib/find_bit.c +0 -14
index 1341bd3..6332ec1 100644
@@ -177,20 +177,6 @@ EXPORT_SYMBOL(find_next_bit_le);
 
 #endif /* __BIG_ENDIAN */
 
-unsigned long find_next_clump8(unsigned long *clump, const unsigned long *addr,
-			       unsigned long size, unsigned long offset)
-{
-	offset = find_next_bit(addr, size, offset);
-	if (offset == size)
-		return size;
-
-	offset = round_down(offset, 8);
-	*clump = bitmap_get_value8(addr, offset);
-
-	return offset;
-}
-EXPORT_SYMBOL(find_next_clump8);
-
 unsigned long find_next_clump(unsigned long *clump, const unsigned long *addr,
 			       unsigned long size, unsigned long offset,
 			       unsigned long clump_size)
lib/test_bitmap.c +0 -65

95 lines not on this page · raw message

Signature · 1 line
2.7.4