]> git.baikalelectronics.ru Git - kernel.git/commit
UBI: fix mean EC calculation
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sat, 19 Apr 2008 17:44:31 +0000 (20:44 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sat, 19 Apr 2008 17:49:41 +0000 (20:49 +0300)
commit3c8dfbd79addbcb07593ef37ab09bf3514642b80
tree4ccfc207a0b55cfad4247f49bd1bce03d5034560
parent0b9de2f201f9002f719941af3bd80e0bff3acb7e
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>
drivers/mtd/ubi/scan.c
drivers/mtd/ubi/scan.h