Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139241
b: refs/heads/master
c: fa7af8b
h: refs/heads/master
i:
  139239: cdad458
v: v3
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Apr 1, 2009
1 parent e2c3423 commit 099ffe2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c08cf9daf66844c60ebe9f89885d3a3e1893e61f
refs/heads/master: fa7af8b1bb6dfca7a0c8541683a9bfffbc8dd345
6 changes: 3 additions & 3 deletions trunk/drivers/rtc/rtc-ds1374.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,16 @@ static int ds1374_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
rtc_tm_to_time(&alarm->time, &new_alarm);
rtc_tm_to_time(&now, &itime);

new_alarm -= itime;

/* This can happen due to races, in addition to dates that are
* truly in the past. To avoid requiring the caller to check for
* races, dates in the past are assumed to be in the recent past
* (i.e. not something that we'd rather the caller know about via
* an error), and the alarm is set to go off as soon as possible.
*/
if (new_alarm <= 0)
if (time_before_eq(new_alarm, itime))
new_alarm = 1;
else
new_alarm -= itime;

mutex_lock(&ds1374->mutex);

Expand Down

0 comments on commit 099ffe2

Please sign in to comment.