public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Devendra Naga <devendra.aaru@gmail.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anatolij Gustschin <agust@denx.de>,
	Andreas Dumberger <andreas.dumberger@tqs.de>,
	rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Cc: Devendra Naga <devendra.aaru@gmail.com>
Subject: [PATCH] rtc/r9701: avoid second call to the rtc_valid_tm
Date: Thu, 21 Jun 2012 12:34:40 +0530	[thread overview]
Message-ID: <1340262280-15096-1-git-send-email-devendra.aaru@gmail.com> (raw)

r9701_get_datetime will call the rtc_valid_tm and it returns the
value returned by rtc_valid_tm, which anyway can be used in the if

so calling rtc_valid_tm is not required.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---


This change is compiled tested only using gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 on x86_64 (intel core i3).

 drivers/rtc/rtc-r9701.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c
index 33b6ba0..e6c34c0 100644
--- a/drivers/rtc/rtc-r9701.c
+++ b/drivers/rtc/rtc-r9701.c
@@ -138,8 +138,7 @@ static int __devinit r9701_probe(struct spi_device *spi)
 	 * contain invalid values. If so, try to write a default date:
 	 * 2000/1/1 00:00:00
 	 */
-	r9701_get_datetime(&spi->dev, &dt);
-	if (rtc_valid_tm(&dt)) {
+	if (r9701_get_datetime(&spi->dev, &dt)) {
 		dev_info(&spi->dev, "trying to repair invalid date/time\n");
 		dt.tm_sec  = 0;
 		dt.tm_min  = 0;
-- 
1.7.9.5


             reply	other threads:[~2012-06-21  7:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-21  7:04 Devendra Naga [this message]
2012-06-21 20:51 ` [PATCH] rtc/r9701: avoid second call to the rtc_valid_tm Andrew Morton
2012-06-22  5:45   ` devendra.aaru

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=1340262280-15096-1-git-send-email-devendra.aaru@gmail.com \
    --to=devendra.aaru@gmail.com \
    --cc=a.zummo@towertech.it \
    --cc=agust@denx.de \
    --cc=akpm@linux-foundation.org \
    --cc=andreas.dumberger@tqs.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox