[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1430883151.28521.1.camel@mtksdaap41>
Date: Wed, 6 May 2015 11:32:31 +0800
From: Eddie Huang <eddie.huang@...iatek.com>
To: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
CC: Joe Perches <joe@...ches.com>, Lee Jones <lee.jones@...aro.org>,
Alessandro Zummo <a.zummo@...ertech.it>,
Matthias Brugger <matthias.bgg@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Tomasz Figa" <tfiga@...gle.com>,
Uwe Kleine-König <kernel@...gutronix.de>,
<srv_heupstream@...iatek.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Greg KH <gregkh@...uxfoundation.org>,
<linux-kernel@...r.kernel.org>, <rtc-linux@...glegroups.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Tianping Fang <tianping.fang@...iatek.com>
Subject: Re: [rtc-linux] [PATCH v3 2/3] rtc: mediatek: Add MT6397 RTC driver
Hi Joe and Alexandre,
On Tue, 2015-05-05 at 23:01 +0200, Alexandre Belloni wrote:
> On 05/05/2015 at 13:44:21 -0700, Joe Perches wrote :
> > I suggest moving the time_after() test into the loop,
> > use break; and remove the exit label too.
> >
> > Maybe something like:
> >
> > while (1) {
> > ret = regmap_read(rtc->regmap, rtc->addr_base + RTC_BBPU,
> > &data);
> > if (ret < 0)
> > break;
> > if (!(data & RTC_BBPU_CBUSY))
> > break;
> > if (time_after(jiffies, timeout)) {
> > ret = -ETIMEDOUT;
> > break;
> > }
> > cpu_relax();
> > }
> >
> > return ret;
>
> That certainly looks more readable.
>
Thanks correct me that I put wrong paramters in time_after, and give me
good example. I will adopt your suggestion in next round.
Eddie
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists