[U-Boot] [PATCH 5/7] net/designware: Try configuring phy on each dw_eth_init

Wolfgang Denk wd at denx.de
Mon Mar 5 20:05:17 CET 2012


Dear Amit Virdi,

In message <4F54AF08.1030003 at st.com> you wrote:
> 
> Surprisingly, I could still not find "true" and "false" defined for ARM
> architecture or in a common file that I can include. Here's what grep 
> gives me

So don't use these.

In theory, any use of #define TRUE / FALSE or enum bool or plain use
of raw 0 and 1 is fine - but only as long as you make sure to use this
consistently within the whole project.

If I am forced to use something like this, I prefer the enum as this
can be decoded by a debugger.  But in general, I try to avod it, and
use plain C logic instead - because then I can just read and
understand the code, in all other cases I have to look up definitions,
especially when it comes to parameter passings.

In your specific case, you use TRUE and FALSE just in one single
place, for one single variable.  Dumpt that.  Use 0 and 1, and
everybody can read the code.

Thanks.

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
What is tolerance? -- it is the consequence of humanity. We  are  all
formed  of frailty and error; let us pardon reciprocally each other's
folly -- that is the first law of nature.                  - Voltaire


More information about the U-Boot mailing list