The patch titled Subject: bitops: introduce for_each_clear_bit() has been added to the -mm tree. Its filename is bitops-introduce-for_each_clear_bit.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Akinobu Mita <akinobu.mita@xxxxxxxxx> Subject: bitops: introduce for_each_clear_bit() Introduce for_each_clear_bit() and for_each_clear_bit_from(). They are similar to for_each_set_bit() and list_for_each_set_bit_from(), but they iterate over all the cleared bits in a memory region. Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx> Cc: Robert Richter <robert.richter@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx> Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx> Cc: Stefano Panella <stefano.panella@xxxxxxx> Cc: David Vrabel <david.vrabel@xxxxxxx> Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/bitops.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff -puN include/linux/bitops.h~bitops-introduce-for_each_clear_bit include/linux/bitops.h --- a/include/linux/bitops.h~bitops-introduce-for_each_clear_bit +++ a/include/linux/bitops.h @@ -32,6 +32,17 @@ extern unsigned long __sw_hweight64(__u6 (bit) < (size); \ (bit) = find_next_bit((addr), (size), (bit) + 1)) +#define for_each_clear_bit(bit, addr, size) \ + for ((bit) = find_first_zero_bit((addr), (size)); \ + (bit) < (size); \ + (bit) = find_next_zero_bit((addr), (size), (bit) + 1)) + +/* same as for_each_clear_bit() but use bit as value to start with */ +#define for_each_clear_bit_from(bit, addr, size) \ + for ((bit) = find_next_zero_bit((addr), (size), (bit)); \ + (bit) < (size); \ + (bit) = find_next_zero_bit((addr), (size), (bit) + 1)) + static __inline__ int get_bitmask_order(unsigned int count) { int order; _ Subject: Subject: bitops: introduce for_each_clear_bit() Patches currently in -mm which might be from akinobu.mita@xxxxxxxxx are origin.patch bitops-rename-for_each_set_bit_cont-in-favor-of-analogous-listh-function.patch bitops-remove-for_each_set_bit_cont.patch bitops-introduce-for_each_clear_bit.patch mtd-use-for_each_clear_bit.patch s390-char-use-for_each_clear_bit.patch uwb-use-for_each_clear_bit.patch x86-use-for_each_clear_bit_from.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html