Skip to contentSkip to conversation

Bad typecast in flash_eraseall ?

DISCUSSION Samuel ]slund 1 participant 1 message Aug 7, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

I recently dovnloaded the mtd-utils-1.0.0.tar.gz from www.infradead.org. When running "flash_eraseall" on a Micrel ks8695p I get some wierd output:

/ # flash_eraseall /dev/mtd1
Erasing 64 Kibyte @ 30000 -- 4294901765 % complete.

When I moved the typecast (unsigned long long) at line 155 from before "erase.start" to before "100" :

                           ("\rErasing %d Kibyte @ %x -- %2llu %% complete.",
                             meminfo.erasesize / 1024, erase.start,
                             erase.start *
                             (unsigned long long) 100 / meminfo.size);

the output became correct:
/ # flash_eraseall /dev/mtd1
Erasing 64 Kibyte @ 100000 -- 26 % complete.

Seems like a bug, thought you might want to know.

//Samuel

PS.
Sorry if this has been mentioned before, I did google a bit on the list archives but the search interface is not very friendly. DS.