Dear Stefano Babic,

In message <4c6557c5.4000...@denx.de> you wrote:
>
> It is ok, but it generates another new CONFIG_ switch, that is unusable
> for the rest of u-boot. I agree that in u-boot there is a lot of
> different and local functions to setup, and probably a general mechanism
> should be better defined. However, setting "#define DEBUG" before any
> include files is quite usual. I do not like to set a CONFIG_ switch only
> for debug purpose, as in the delivered system all debug output should be
> turned off.

We already have such a general mechanism, the problem is just that
people ignore it and re-invent the wheel.

We have debug(), debugX(), error(), and BUG_ON().

What exactly seems to be missing?

Note that when using constants as "level" argument in debugX() the
compiler can even optimize away non-relevant code.

I remember we had a similar discussion in the past, which resulted
that I accepted to have debugX() added - yet how many files use it?
2 (in words: TWO)!

So before we add even more debug utilities someone has to bring up
really good arguments to convince me.

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: w...@denx.de
"Where shall I begin, please your Majesty?" he asked. "Begin  at  the
beginning,"  the  King said, gravely, "and go on till you come to the
end: then stop."    - Alice's Adventures in Wonderland, Lewis Carroll
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to