projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03f4a82
)
mtd: use for_each_clear_bit()
author
Akinobu Mita
<
[email protected]
>
Fri, 23 Mar 2012 22:02:05 +0000
(15:02 -0700)
committer
Linus Torvalds
<
[email protected]
>
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 <
[email protected]
>
Cc: David Woodhouse <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/mtd/chips/cfi_cmdset_0001.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/chips/cfi_cmdset_0001.c
b/drivers/mtd/chips/cfi_cmdset_0001.c
index e1e122f2f92912bcc71d2418ffea1f3e77aeb3fa..9bcd1f415f43f137631793e8371ffb6899b5d92c 100644
(file)
--- 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)
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);
}
}
}