[U-Boot-Users] [PATCH] mips: tolerate the MIPS 'CFG_HZ' values in the MHZ range for NAND delays

Wolfgang Denk wd at denx.de
Mon May 19 23:14:18 CEST 2008


In message <20080519210409.GA3803 at mail.gnudd.com> you wrote:
> 
> > If possible, we *want* the preprocessor to remove any code that does
> > not apply for a specific configuration. Generating code just bloats
> > the memory footprint.
> 
> Definitely. 
> 
> But constant expressions are evaluated at compile time. So the dead
> branch (if or else) doesn't generate any object code. There is no
> memory footprint overhead.
> 
> When possible, I prefer to use C conditionals rather than preprocessor
> conditionals. I raised the point because I see u-boot wants to get rid
> of preprocessor mess when it brings no cost.

In general, you are of course right.

In this specific case, I feel an immediate allergic reaction  because
it makes the code look even more as if CFG_HZ was a variable ;-)

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Es sind überhaupt nur die Dummköpfe, die sich den Befehlen der  Mäch-
tigen  widersetzen.  Um  sie  zu ruinieren ist es genug, ihre Befehle
treu zu erfüllen.                  - Peter Hacks: "Die schöne Helena"




More information about the U-Boot mailing list