if (strcmp(cmd, "bad") == 0) {
printf("\nDevice %d bad blocks:\n", dev);
- for (off = 0; off < mtd->size; off += mtd->erasesize)
- if (nand_block_isbad(mtd, off))
- printf(" %08llx\n", (unsigned long long)off);
+ for (off = 0; off < mtd->size; off += mtd->erasesize) {
+ ret = nand_block_isbad(mtd, off);
+ if (ret)
+ printf(" 0x%08llx%s\n", (unsigned long long)off,
+ ret == 2 ? "\t (bbt reserved)" : "");
+ }
return 0;
}