]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390/char: use for_each_clear_bit()
authorAkinobu Mita <akinobu.mita@gmail.com>
Fri, 23 Mar 2012 22:02:05 +0000 (15:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 23 Mar 2012 23:58:34 +0000 (16:58 -0700)
Use for_each_clear_bit() to iterate over all the cleared bit in a
memory region.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/s390/char/sclp_cmd.c

index 0b54a91f8dcd2aa23d23634910fb92a683cea949..168525a9c2928b4c6a591ea9b89dc2fbaac978ac 100644 (file)
@@ -441,9 +441,8 @@ static int sclp_mem_notifier(struct notifier_block *nb,
        start = arg->start_pfn << PAGE_SHIFT;
        size = arg->nr_pages << PAGE_SHIFT;
        mutex_lock(&sclp_mem_mutex);
-       for (id = 0; id <= sclp_max_storage_id; id++)
-               if (!test_bit(id, sclp_storage_ids))
-                       sclp_attach_storage(id);
+       for_each_clear_bit(id, sclp_storage_ids, sclp_max_storage_id + 1)
+               sclp_attach_storage(id);
        switch (action) {
        case MEM_ONLINE:
        case MEM_GOING_OFFLINE: