From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 25 Aug 2011 14:15:00 +0200 Subject: [U-Boot] [PATCH v2 1/3] net: Adds Fast Ethernet Controller driver for Armada100 In-Reply-To: <316561839.535.1314249685865.JavaMail.root@ahm.einfochips.com> References: <316561839.535.1314249685865.JavaMail.root@ahm.einfochips.com> Message-ID: <201108251415.00681.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday, August 25, 2011 07:21:25 AM Ajay Bhargav wrote: > ----- "Marek Vasut" 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 > > > --- > > > > [...] > > [...] > > > > + > > > +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