summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_mtdparts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 17865b7..5481c88 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -1228,15 +1228,16 @@ static int generate_mtdparts_save(char *buf, u32 buflen)
*/
static uint64_t net_part_size(struct mtd_info *mtd, struct part_info *part)
{
+ uint64_t i, net_size = 0;
+
if (!mtd->block_isbad)
return part->size;
- uint64_t i, net_size = 0;
-
for (i = 0; i < part->size; i += mtd->erasesize) {
if (!mtd->block_isbad(mtd, part->offset + i))
net_size += mtd->erasesize;
}
+
return net_size;
}
#endif