[U-Boot] [PATCH v2 1/3] net: Adds Fast Ethernet Controller driver for Armada100

Marek Vasut marek.vasut at gmail.com
Thu Aug 25 14:15:00 CEST 2011


On Thursday, August 25, 2011 07:21:25 AM Ajay Bhargav wrote:
> ----- "Marek Vasut" <marek.vasut at gmail.com> wrote:
> > On Wednesday, August 24, 2011 03:07:18 PM Ajay Bhargav wrote:
> > > This patch adds support for Fast Ethernet Controller driver for
> > > Armada100 series.
> > > 
> > > Signed-off-by: Ajay Bhargav <ajay.bhargav at einfochips.com>
> > > ---
> > 
> > [...]
> 
> [...]
> 
> > > +
> > > +static int armdfec_phy_timeout(u32 reg, u32 flag, int cond)
> > > +{
> > > +	u32 timeout = PHY_WAIT_ITERATIONS;
> > > +	while (--timeout) {
> > > +		if (cond && (readl(reg) & flag))
> > > +			break;
> > > +		else if (!cond && !(readl(reg) & flag))
> > 
> > You can read the register into some temporary variable so you don't
> > need the
> > readl() at two places.
> 
> readl will be called only once... do i really need a temp var?
> 

I think it'll help the readability a bit.

Cheers


More information about the U-Boot mailing list