mtd: redboot: remove useless code
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon Mar 26 20:59:08 EDT 2012
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=050c0c1bb2604a62bb250ff6181e9c00727da510
Commit: 050c0c1bb2604a62bb250ff6181e9c00727da510
Parent: b25675722acf8a81638afb1124b38c4752299fa5
Author: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
AuthorDate: Fri Feb 3 11:37:47 2012 +0200
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Tue Mar 27 00:24:14 2012 +0100
mtd: redboot: remove useless code
We do not need to invoke 'mtd_can_have_bb()' before invoking
'mtd_block_isbad()' because the latter already handles the case when the MTD
device does not support bad blocks.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/redboot.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c
index 48970c1..580035c 100644
--- a/drivers/mtd/redboot.c
+++ b/drivers/mtd/redboot.c
@@ -78,8 +78,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
if ( directory < 0 ) {
offset = master->size + directory * master->erasesize;
- while (mtd_can_have_bb(master) &&
- mtd_block_isbad(master, offset)) {
+ while (mtd_block_isbad(master, offset)) {
if (!offset) {
nogood:
printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n");
@@ -89,8 +88,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
}
} else {
offset = directory * master->erasesize;
- while (mtd_can_have_bb(master) &&
- mtd_block_isbad(master, offset)) {
+ while (mtd_block_isbad(master, offset)) {
offset += master->erasesize;
if (offset == master->size)
goto nogood;
More information about the linux-mtd-cvs
mailing list