Bad typecast in flash_eraseall ?

Samuel ]slund samuel at Update.UU.SE
Mon Aug 7 06:42:32 EDT 2006


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.




More information about the linux-mtd mailing list