[U-Boot] [PATCH v2 3/8] USB-CDC: Use native debug printout macros
Wolfgang Denk
wd at denx.de
Fri Aug 13 22:56:17 CEST 2010
Dear Stefano Babic,
In message <4C6557C5.4000300 at 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: wd at 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
More information about the U-Boot
mailing list