Commit c527b414 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds

mtd: use for_each_clear_bit()

Use for_each_clear_bit() to iterate over all the cleared bit in a
memory region.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 03f4a822
...@@ -2526,12 +2526,10 @@ static void cfi_intelext_restore_locks(struct mtd_info *mtd) ...@@ -2526,12 +2526,10 @@ static void cfi_intelext_restore_locks(struct mtd_info *mtd)
if (!region->lockmap) if (!region->lockmap)
continue; continue;
for (block = 0; block < region->numblocks; block++) { for_each_clear_bit(block, region->lockmap, region->numblocks) {
len = region->erasesize; len = region->erasesize;
adr = region->offset + block * len; adr = region->offset + block * len;
cfi_intelext_unlock(mtd, adr, len);
if (!test_bit(block, region->lockmap))
cfi_intelext_unlock(mtd, adr, len);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment