LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
	David Brownell <david-b@pacbell.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms
Date: Mon, 27 Oct 2008 15:38:24 +0000	[thread overview]
Message-ID: <1225121905-23782-1-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)

When fixing up invalid years rtc_read_alarm() is callign rtc_valid_tm()
as a boolean but rtc_valid_tm() returns zero on success or a negative
number if the time is not valid so the test is inverted.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/rtc/interface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 7af60b9..a04c1b6 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -271,7 +271,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
 		dev_dbg(&rtc->dev, "alarm rollover: %s\n", "year");
 		do {
 			alarm->time.tm_year++;
-		} while (!rtc_valid_tm(&alarm->time));
+		} while (rtc_valid_tm(&alarm->time) != 0);
 		break;
 
 	default:
-- 
1.5.6.5


             reply	other threads:[~2008-10-27 15:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 15:38 Mark Brown [this message]
2008-10-27 15:38 ` [PATCH 2/2] rtc: rtc-wm8350: Add support for WM8350 RTC Mark Brown
2008-10-27 17:04   ` [rtc-linux] " Alessandro Zummo
2008-10-27 17:24     ` [rtc-linux] " Mark Brown
2008-10-27 17:26       ` Alessandro Zummo
2008-10-27 17:40         ` Mark Brown
2008-10-28  6:24           ` Andrew Morton
2008-10-27 20:03     ` [rtc-linux] " David Brownell
2008-10-27 20:09       ` Mark Brown
2008-10-27 20:19         ` David Brownell
2008-10-28  6:22   ` Andrew Morton
2008-10-28 10:02     ` Mark Brown
2008-10-27 16:51 ` [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms Alessandro Zummo
  -- strict thread matches above, loose matches on Subject: below --
2008-10-20 19:33 [PATCH 0/2] RTC updates Mark Brown
2008-10-20 19:35 ` [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms Mark Brown

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=1225121905-23782-1-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --subject='Re: [PATCH 1/2] rtc: Fix handling of missing tm_year data when reading alarms' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).