All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eddie Huang <eddie.huang@mediatek.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: "Joe Perches" <joe@perches.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Tomasz Figa" <tfiga@google.com>,
	"Uwe Kleine-König" <kernel@pengutronix.de>,
	srv_heupstream@mediatek.com,
	"Samuel Ortiz" <sameo@linux.intel.com>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	"Tianping Fang" <tianping.fang@mediatek.com>
Subject: Re: [rtc-linux] [PATCH v3 2/3] rtc: mediatek: Add MT6397 RTC driver
Date: Wed, 6 May 2015 11:32:31 +0800	[thread overview]
Message-ID: <1430883151.28521.1.camel@mtksdaap41> (raw)
In-Reply-To: <20150505210131.GR4276@piout.net>

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

WARNING: multiple messages have this Message-ID (diff)
From: Eddie Huang <eddie.huang@mediatek.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: "Joe Perches" <joe@perches.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Tomasz Figa" <tfiga@google.com>,
	"Uwe Kleine-König" <kernel@pengutronix.de>,
	srv_heupstream@mediatek.com,
	"Samuel Ortiz" <sameo@linux.intel.com>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	"Tianping Fang" <tianping.fang@mediatek.com>
Subject: Re: [rtc-linux] [PATCH v3 2/3] rtc: mediatek: Add MT6397 RTC driver
Date: Wed, 6 May 2015 11:32:31 +0800	[thread overview]
Message-ID: <1430883151.28521.1.camel@mtksdaap41> (raw)
In-Reply-To: <20150505210131.GR4276@piout.net>

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


-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: eddie.huang@mediatek.com (Eddie Huang)
To: linux-arm-kernel@lists.infradead.org
Subject: [rtc-linux] [PATCH v3 2/3] rtc: mediatek: Add MT6397 RTC driver
Date: Wed, 6 May 2015 11:32:31 +0800	[thread overview]
Message-ID: <1430883151.28521.1.camel@mtksdaap41> (raw)
In-Reply-To: <20150505210131.GR4276@piout.net>

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

  reply	other threads:[~2015-05-06  3:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28  7:35 [PATCH v3 0/3] Add Mediatek SoC RTC driver Eddie Huang
2015-04-28  7:35 ` Eddie Huang
2015-04-28  7:35 ` Eddie Huang
2015-04-28  7:35 ` [rtc-linux] " Eddie Huang
2015-04-28  7:35 ` [PATCH v3 1/3] mfd: provide RTC resource in MT6397 MFD Eddie Huang
2015-04-28  7:35   ` Eddie Huang
2015-04-28  7:35   ` Eddie Huang
2015-04-28  7:35   ` [rtc-linux] " Eddie Huang
2015-04-28  7:45   ` Uwe Kleine-König
2015-04-28  7:45     ` Uwe Kleine-König
2015-04-28  7:45     ` [rtc-linux] " Uwe Kleine-König
2015-04-28 10:07   ` Lee Jones
2015-04-28 10:07     ` Lee Jones
2015-04-28 10:07     ` [rtc-linux] " Lee Jones
2015-04-28  7:35 ` [PATCH v3 2/3] rtc: mediatek: Add MT6397 RTC driver Eddie Huang
2015-04-28  7:35   ` Eddie Huang
2015-04-28  7:35   ` Eddie Huang
2015-04-28  7:35   ` [rtc-linux] " Eddie Huang
2015-05-05 20:00   ` Alexandre Belloni
2015-05-05 20:00     ` Alexandre Belloni
2015-05-05 20:00     ` Alexandre Belloni
2015-05-05 20:44     ` Joe Perches
2015-05-05 20:44       ` Joe Perches
2015-05-05 20:44       ` Joe Perches
2015-05-05 21:01       ` Alexandre Belloni
2015-05-05 21:01         ` Alexandre Belloni
2015-05-05 21:01         ` Alexandre Belloni
2015-05-06  3:32         ` Eddie Huang [this message]
2015-05-06  3:32           ` Eddie Huang
2015-05-06  3:32           ` Eddie Huang
2015-04-28  7:35 ` [PATCH v3 3/3] MAINTAINERS: add Mediatek " Eddie Huang
2015-04-28  7:35   ` Eddie Huang
2015-04-28  7:35   ` Eddie Huang
2015-04-28  7:35   ` [rtc-linux] " Eddie Huang
2015-05-05 20:03   ` Alexandre Belloni
2015-05-05 20:03     ` Alexandre Belloni
2015-05-05 20:03     ` Alexandre Belloni
2015-05-06  3:36     ` Eddie Huang
2015-05-06  3:36       ` Eddie Huang
2015-05-06  3:36       ` Eddie Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430883151.28521.1.camel@mtksdaap41 \
    --to=eddie.huang@mediatek.com \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=tfiga@google.com \
    --cc=tianping.fang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.