From: Wolfgang Denk Date: Wed, 19 Aug 2009 21:40:25 +0200 Subject: [U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init In-Reply-To: <4A8C5288.5020308@gmail.com> References: <20090819122415.0487b2d8@marrow.netinsight.se> <4A8C3172.70001@gmail.com> <20090819192510.BD75D833DBD2@gemini.denx.de> <4A8C5288.5020308@gmail.com> Message-ID: <20090819194025.CC28E833DBD2@gemini.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 Dear Ben Warren, In message <4A8C5288.5020308@gmail.com> you wrote: > > >>> + /* Wait up to 5s for the link status */ > >>> + for (i = 0; i < 5; i++) { > >>> + u16 phyadr; > >>> > >> Please put this variable declaration outside of the 'for' loop > >> > > > > Why? If it's only used in this block it's actually a good thing to > > restrict it to this scope. > > > It seems your coding standards have changed, which everybody knows is > impossible. Where's you put the old Wolfgang, doppleganger? :) Oops? I think you must be wrong. I have always been a friend of declaring variables such that they have minimal scope. Back in the old days when I started to learn C this helped to keep the stack size low. Did I really ever say anything against such practice? I'm always fighting against variable declarations mixed in the middle of code, of course, but this here is done right: at the begin of a new block. 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 There's an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone.