diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-03-23 18:02:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:34 -0400 |
commit | c527b414ca3daf0b0c616992d3b580486926a8e9 (patch) | |
tree | a6e5241e205c1bcf69df37c81ec967cfce570355 /drivers/mtd/chips | |
parent | 03f4a8226c2f9c14361f75848d1e93139bab90c4 (diff) |
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>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index e1e122f2f929..9bcd1f415f43 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -2526,12 +2526,10 @@ static void cfi_intelext_restore_locks(struct mtd_info *mtd) | |||
2526 | if (!region->lockmap) | 2526 | if (!region->lockmap) |
2527 | continue; | 2527 | continue; |
2528 | 2528 | ||
2529 | for (block = 0; block < region->numblocks; block++) { | 2529 | for_each_clear_bit(block, region->lockmap, region->numblocks) { |
2530 | len = region->erasesize; | 2530 | len = region->erasesize; |
2531 | adr = region->offset + block * len; | 2531 | adr = region->offset + block * len; |
2532 | 2532 | cfi_intelext_unlock(mtd, adr, len); | |
2533 | if (!test_bit(block, region->lockmap)) | ||
2534 | cfi_intelext_unlock(mtd, adr, len); | ||
2535 | } | 2533 | } |
2536 | } | 2534 | } |
2537 | } | 2535 | } |