From: Lothar Waßmann Date: Wed, 29 Jun 2016 08:51:31 +0000 (+0200) Subject: common/cmd_mtdparts.c: print ECC stats along with partition information X-Git-Tag: KARO-TX-2016-07-05~6 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=767d85aea1caef40727db808a1c8a481bdb2358c common/cmd_mtdparts.c: print ECC stats along with partition information --- diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c index 913e766f19..33096c05b2 100644 --- a/common/cmd_mtdparts.c +++ b/common/cmd_mtdparts.c @@ -1233,6 +1233,18 @@ static uint64_t net_part_size(struct mtd_info *mtd, struct part_info *part) } #endif +static void show_ecc_stats(struct mtd_device *dev) +{ + struct mtd_info *mtd; + + if (get_mtd_info(dev->id->type, dev->id->num, &mtd)) + return; + + printf("ECC stats for device %s:\n", mtd->name); + printf(" corrected bit flips:\t%4u\n", mtd->ecc_stats.corrected); + printf(" uncorrectable errors:\t%4u\n", mtd->ecc_stats.failed); +} + static void print_partition_table(void) { struct list_head *dentry, *pentry; @@ -1280,6 +1292,7 @@ static void print_partition_table(void) #endif /* defined(CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES) */ part_num++; } + show_ecc_stats(dev); } if (list_empty(&devices))