aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/sleep/proc.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index 1538355c266b..e19eb0c25e62 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -251,27 +251,6 @@ acpi_system_write_alarm(struct file *file,
251 if ((result = get_date_field(&p, &sec))) 251 if ((result = get_date_field(&p, &sec)))
252 goto end; 252 goto end;
253 253
254 if (sec > 59) {
255 min += 1;
256 sec -= 60;
257 }
258 if (min > 59) {
259 hr += 1;
260 min -= 60;
261 }
262 if (hr > 23) {
263 day += 1;
264 hr -= 24;
265 }
266 if (day > 31) {
267 mo += 1;
268 day -= 31;
269 }
270 if (mo > 12) {
271 yr += 1;
272 mo -= 12;
273 }
274
275 spin_lock_irq(&rtc_lock); 254 spin_lock_irq(&rtc_lock);
276 255
277 rtc_control = CMOS_READ(RTC_CONTROL); 256 rtc_control = CMOS_READ(RTC_CONTROL);
@@ -288,24 +267,24 @@ acpi_system_write_alarm(struct file *file,
288 spin_unlock_irq(&rtc_lock); 267 spin_unlock_irq(&rtc_lock);
289 268
290 if (sec > 59) { 269 if (sec > 59) {
291 min++; 270 min += sec/60;
292 sec -= 60; 271 sec = sec%60;
293 } 272 }
294 if (min > 59) { 273 if (min > 59) {
295 hr++; 274 hr += min/60;
296 min -= 60; 275 min = min%60;
297 } 276 }
298 if (hr > 23) { 277 if (hr > 23) {
299 day++; 278 day += hr/24;
300 hr -= 24; 279 hr = hr%24;
301 } 280 }
302 if (day > 31) { 281 if (day > 31) {
303 mo++; 282 mo += day/32;
304 day -= 31; 283 day = day%32;
305 } 284 }
306 if (mo > 12) { 285 if (mo > 12) {
307 yr++; 286 yr += mo/13;
308 mo -= 12; 287 mo = mo%13;
309 } 288 }
310 289
311 spin_lock_irq(&rtc_lock); 290 spin_lock_irq(&rtc_lock);