From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Fri, 13 Aug 2010 16:33:41 +0200 Subject: [U-Boot] [PATCH v2 3/8] USB-CDC: Use native debug printout macros In-Reply-To: <4C654B30.9060106@mvista.com> References: <1281617086-21220-1-git-send-email-vkuzmichev@mvista.com> <1281704276-29115-1-git-send-email-vkuzmichev@mvista.com> <4C6542A3.5040009@dawes.za.net> <4C6544B9.3000503@mvista.com> <4C6548FE.4020902@denx.de> <4C654B30.9060106@mvista.com> Message-ID: <4C6557C5.4000300@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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? > 1) > #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). > > 2) > #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 -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================