summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/scan.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-04-19 17:44:31 (GMT)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-04-19 17:49:41 (GMT)
commit4bc1dca4b0eb4dfbf100895bfc1256f21e3c901a (patch)
tree4ccfc207a0b55cfad4247f49bd1bce03d5034560 /drivers/mtd/ubi/scan.h
parentcbd8a9d2cd6f576ca41022599341bbd8be1b0b27 (diff)
downloadlinux-fsl-qoriq-4bc1dca4b0eb4dfbf100895bfc1256f21e3c901a.tar.xz
UBI: fix mean EC calculation
(a + b) / (c + d) != a / c + b / d. The old code errornously assumed this incorrect formuld. Instead, just sum all erase counters in a 64-bit variable and divide to the number of EBs at the end. Thanks to Adrian Hunter for pointing this out. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.h')
-rw-r--r--drivers/mtd/ubi/scan.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/scan.h b/drivers/mtd/ubi/scan.h
index 46d444a..966b9b6 100644
--- a/drivers/mtd/ubi/scan.h
+++ b/drivers/mtd/ubi/scan.h
@@ -124,7 +124,7 @@ struct ubi_scan_info {
int max_ec;
unsigned long long max_sqnum;
int mean_ec;
- int ec_sum;
+ uint64_t ec_sum;
int ec_count;
};