summaryrefslogtreecommitdiff
path: root/include/linux/bitops.h
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2019-12-04 15:19:39 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2019-12-04 15:19:39 +1100
commitae8640a55a159e19d05b95a7e96a3c5413c104ac (patch)
tree7a2ba022dcdea4d7f9c745c99168f7ad0343453f /include/linux/bitops.h
parent870dc228f65ec095966e677885003491d3de795b (diff)
parentd7a7648465d2aca5dce07daf37dd6d8a6376a61a (diff)
downloadlinux-next-ae8640a55a159e19d05b95a7e96a3c5413c104ac.tar.gz
Merge branch 'akpm-current/current'
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r--include/linux/bitops.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index c94a9ff9f082..e479067c202c 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -47,6 +47,18 @@ extern unsigned long __sw_hweight64(__u64 w);
(bit) < (size); \
(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))
+
static inline int get_bitmask_order(unsigned int count)
{
int order;