[U-Boot-Users] main clock calculation invalid

Wolfgang Denk wd at denx.de
Fri Apr 20 10:18:05 CEST 2007


In message <47F3F98010FF784EBEE6526EAAB078D1024F8528 at tq-mailsrv.tq-net.de> you wrote:
> 
> You could rearrange your formula:
> 
> CONFIG_SYS_CLK_FREQ / ((prediv + 2) * (1 << ps)) * (maindiv2 + 2) *
> (maindiv1 + 2)
> 
> The compiler should do the calculation from left to right.

And if in doubt, use parens to define the order of evaluation.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A man either lives life as it happens to him, meets  it  head-on  and
licks it, or he turns his back on it and starts to wither away.
	-- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknown




More information about the U-Boot mailing list