Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84108
b: refs/heads/master
c: 0879802
h: refs/heads/master
v: v3
  • Loading branch information
Yi Yang authored and Len Brown committed Dec 28, 2007
1 parent 61e2026 commit 10b9d8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 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: 975c30257e75c3d067d4858f60963b80fc6bd0e4
refs/heads/master: 087980295082ccaa816330bc69c29a2ff53a244c
46 changes: 10 additions & 36 deletions trunk/drivers/acpi/sleep/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ static int get_date_field(char **p, u32 * value)
* Try to find delimeter, only to insert null. The end of the
* string won't have one, but is still valid.
*/
if (*p == NULL)
return result;

next = strpbrk(*p, "- :");
if (next)
*next++ = '\0';
Expand All @@ -193,8 +190,6 @@ static int get_date_field(char **p, u32 * value)

if (next)
*p = next;
else
*p = NULL;

return result;
}
Expand Down Expand Up @@ -256,27 +251,6 @@ acpi_system_write_alarm(struct file *file,
if ((result = get_date_field(&p, &sec)))
goto end;

if (sec > 59) {
min += 1;
sec -= 60;
}
if (min > 59) {
hr += 1;
min -= 60;
}
if (hr > 23) {
day += 1;
hr -= 24;
}
if (day > 31) {
mo += 1;
day -= 31;
}
if (mo > 12) {
yr += 1;
mo -= 12;
}

spin_lock_irq(&rtc_lock);

rtc_control = CMOS_READ(RTC_CONTROL);
Expand All @@ -293,24 +267,24 @@ acpi_system_write_alarm(struct file *file,
spin_unlock_irq(&rtc_lock);

if (sec > 59) {
min++;
sec -= 60;
min += sec/60;
sec = sec%60;
}
if (min > 59) {
hr++;
min -= 60;
hr += min/60;
min = min%60;
}
if (hr > 23) {
day++;
hr -= 24;
day += hr/24;
hr = hr%24;
}
if (day > 31) {
mo++;
day -= 31;
mo += day/32;
day = day%32;
}
if (mo > 12) {
yr++;
mo -= 12;
yr += mo/13;
mo = mo%13;
}

spin_lock_irq(&rtc_lock);
Expand Down

0 comments on commit 10b9d8b

Please sign in to comment.