erase_unit_header_t hdr, hdr2;
off_t i;
u_int j, nbam, *bam;
- int control, data, free, deleted;
+ int control, data, blk_free, deleted;
/* Get partition size, block size */
if (ioctl(fd, MEMGETINFO, &mtd) != 0) {
perror("read failed");
break;
}
- free = deleted = control = data = 0;
+ blk_free = deleted = control = data = 0;
for (j = 0; j < nbam; j++) {
if (BLOCK_FREE(le32_to_cpu(bam[j])))
- free++;
+ blk_free++;
else if (BLOCK_DELETED(le32_to_cpu(bam[j])))
deleted++;
else switch (BLOCK_TYPE(le32_to_cpu(bam[j]))) {
}
}
printf(" Block allocation: %d control, %d data, %d free,"
- " %d deleted\n", control, data, free, deleted);
+ " %d deleted\n", control, data, blk_free, deleted);
}
}
+
+ free(bam);
} /* format_partition */
/* Show usage information */