From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Tue, 25 Mar 2008 15:40:56 +0100 Subject: [U-Boot-Users] [PATCH] USB Storage, add meaningful return value In-Reply-To: <47E90AEF.9010702@freescale.com> References: <20080325000744.4CC59248BE@gemini.denx.de> <47E845EA.9010804@gmail.com> <47E90AEF.9010702@freescale.com> Message-ID: <200803251540.56776.sr@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 On Tuesday 25 March 2008, Jon Loeliger wrote: > > It doesn't have braces on the "if (usb_max_devs > 0)" which is > > syntactically OK but the source of the coding violation. Please add > > braces after the "if" and "} else {" per Wolfgang's comments. > > > > Thanks for making the code a little better and a little prettier, ;-) > > gvb > > Hey Stefan, Why me? :) > What do you think? Wouldn't a policy of _always_ using > braces even for single sub-statements have just made this > a _correct_ no-brainer from the onset? :-) I think I read some time on LKML, that braces should be used on all multi-line paragraphs. So even one statement with a comment should have braces. That's what I would prefer. And braces on both parts of the "else" if one needs them. So something like is what I would vote for: if (a == b) { /* some comment */ c = 1; } else { c = 2; } But I still prefer using no braces on single line paragraph: if (a == b) c = 1; else c = 2; Best regards, Stefan ===================================================================== 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 =====================================================================