Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Artem Bityutskiy and committed by
David Woodhouse
050c0c1b b2567572

+2 -4
+2 -4
drivers/mtd/redboot.c
··· 78 78 79 79 if ( directory < 0 ) { 80 80 offset = master->size + directory * master->erasesize; 81 - while (mtd_can_have_bb(master) && 82 - mtd_block_isbad(master, offset)) { 81 + while (mtd_block_isbad(master, offset)) { 83 82 if (!offset) { 84 83 nogood: 85 84 printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n"); ··· 88 89 } 89 90 } else { 90 91 offset = directory * master->erasesize; 91 - while (mtd_can_have_bb(master) && 92 - mtd_block_isbad(master, offset)) { 92 + while (mtd_block_isbad(master, offset)) { 93 93 offset += master->erasesize; 94 94 if (offset == master->size) 95 95 goto nogood;