From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Wed, 12 Aug 2009 12:02:33 +0200 Subject: [U-Boot] [PATCH] Make TFTP Quiet In-Reply-To: (Timur Tabi's message of "Mon, 10 Aug 2009 15:55:20 -0500") References: <200908101626.20218.rgetz@blackfin.uclinux.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Timur, >> +#ifdef CONFIG_TFTP_QUIET >> +#define puts_quiet(fmt) >> +#else >> +#define puts_quiet(fmt) ? ? ? ? ? ? ? ?puts(fmt); >> +#endif > > This looks backwards to me. I would do this: > > #ifdef CONFIG_TFTP_QUIET > #define puts(x) puts_quiet(x) > #endif > > That way, you don't need to change all of the puts calls to > puts_quiet. Plus, having the normal calls be "puts_quiet" that > changes to puts when QUIET is *not* enabled just feels wrong. Just as a general remark - I consider it a bad idea to "overload" well known functions with non-standard behaviour. This breaks the "principle of least surprise" which turns out to be very valuable. Cheers Detlev -- It was actually a very beautiful thing to see a sunrise, cause' that's such a calm time of day. It's a wonderful time of day to get ready to go to bed. -- Richard M. Stallman -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de