
Vitaly Kuzmichev wrote:
Hi Stefano,
Hi Vitaly,
Stefano Babic wrote:
If you want to remember how to set the debug output, it should be enough to add a comments with "to enable the debugging, define DEBUG before common.h" or something like that. I vote to remove only the two lines...
Would not it be better to make one of the following?
#if 0 #define DEBUG #endif
However, this is seen as dead code. As this one, my preferance is to set only a comment (I see several files in u-boot with such a comment, for example arch/arm/lib/board.c).
#ifdef CONFIG_USB_ETH_DEBUG #define DEBUG #endif
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.
Best regards, Stefano