diff options
author | Brian Norris <computersforpeace@gmail.com> | 2010-10-16 13:54:05 -0700 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-10-17 11:07:25 +0300 |
commit | cafa878ec4cf894821a0b1c7a41417baa58a635d (patch) | |
tree | dd25c6e137cd4214e83cbd3fbd099f722523c8d0 /ubi-utils/src/libubi.c | |
parent | 00fc2d4d47e87536c89509f234777fc7d93cab9e (diff) |
mtd-utils: flash_erase: Fix output of offsets
Need to use unsigned arithmetic and a 64-bit cast in order to
calculate and output the correct offset for eraseblocks at large
offsets. Signed integer arithmetic does not produce the correct
result "uint64_t" result, so for offsets over 2GB we get
messages like:
Erasing 512 Kibyte @ ffffffff83180000 -- 4308642136 % complete.
Note that this error was not affecting proper erasure; it just
produced incorrect status messages.
Also, we should not add an extra eraseblock for the final status
message; this gives misleading output when, for example, the
following statement is executed:
$ flash_erase /dev/mtd0 0 1
Erasing 512 Kibyte @ 80000 -- 100 % complete
We aren't erasing at offset 0x80000; it should display offset 0.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/src/libubi.c')
0 files changed, 0 insertions, 0 deletions