mirror of
https://github.com/torvalds/linux.git
synced 2024-10-31 01:01:52 +00:00
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: Akinobu Mita <akinobu.mita@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
03f4a8226c
commit
c527b414ca
@ -2526,12 +2526,10 @@ static void cfi_intelext_restore_locks(struct mtd_info *mtd)
|
||||
if (!region->lockmap)
|
||||
continue;
|
||||
|
||||
for (block = 0; block < region->numblocks; block++) {
|
||||
for_each_clear_bit(block, region->lockmap, region->numblocks) {
|
||||
len = region->erasesize;
|
||||
adr = region->offset + block * len;
|
||||
|
||||
if (!test_bit(block, region->lockmap))
|
||||
cfi_intelext_unlock(mtd, adr, len);
|
||||
cfi_intelext_unlock(mtd, adr, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user