[U-Boot] [PATCH] arm:kirkwood Wait for the link to come up on kirkwood network init

Wolfgang Denk wd at denx.de
Wed Aug 19 21:40:25 CEST 2009


Dear Ben Warren,

In message <4A8C5288.5020308 at 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.


More information about the U-Boot mailing list