
Dear Timur Tabi,
In message 4BF6ECD0.4060202@freescale.com you wrote:
However, the current code adds a 1 to the result, which is definitely wrong. On my board, for example, it returns 99999001, which is not correct. So the existing "rounding" algorithm is broken.
Agreed.
However, I believe that displaying 799.999 MHz instead of 800 MHz is silly. The problem is that strmhz() rounds to the nearest KHz. I wonder if that's really useful. Perhaps we should make it act more like print_size(), where
Well, the function is "strMHZ", and it prints a frequency in MHz with exactly 3 digits precision - so rounding to the nearest kHz is exactly the right thing to do.
it prints KHz, MHz, or GHz as appropriate, and rounds to the nearest 10th, instead of 1000th.
That would IMHO be less useful, and require changes to MANY boards (essentially all of them) as the output format needs to be adjusted.
Best regards,
Wolfgang Denk