diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2019-10-31 16:55:10 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2019-10-31 16:55:10 +1100 |
commit | cc9ab103ea566547124232cf03525834f06a9e55 (patch) | |
tree | 2bcadccb69998fec25678309b6826ff349a9d4e2 /include/linux/bitops.h | |
parent | cbf83a411543bc3296abee873842ee8ff2a3e6b7 (diff) | |
parent | 528ab4a96af0b31981f362addec1913a376dacbc (diff) |
Merge branch 'akpm/master'
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r-- | include/linux/bitops.h | 12 |
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; |