Files
linux/drivers
Yi Yang 0879802950 ACPI: /proc/acpi/alarm parsing: handle large numbers properly
In function acpi_system_write_alarm in file drivers/acpi/sleep/proc.c,
big sec, min, hr, mo, day and yr are counted twice to get reasonable
values, that is very superfluous, we can do that only once.

In additon, /proc/acpi/alarm can set a related value which can be
specified as YYYY years MM months DD days HH hours MM minutes SS
senconds, it isn't a date, so you can specify as +0000-00-00 96:00:00
, that means 3 days later, current code can't handle such a case.

This patch removes unnecessary code and does with the aforementioned
situation.

Before applying this patch:

[root@localhost /]# cat /proc/acpi/alarm
2007-12-00 00:00:00
[root@localhost /]# echo "0000-00-00 96:180:180" > /proc/acpi/alarm
[root@localhost /]# cat /proc/acpi/alarm
0007-12-02 **:**:**
[root@localhost /]#

After applying this patch:

[root@localhost ~]# echo "2007-12-00 00:00:00" > /proc/acpi/alarm
[root@localhost ~]# cat /proc/acpi/alarm
2007-12-00 00:00:00
[root@localhost ~]# echo "0000-00-00 96:180:180" > /proc/acpi/alarm
[root@localhost ~]# cat /proc/acpi/alarm
0007-12-04 03:03:00
[root@localhost ~]#

Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2007-12-27 22:04:26 -05:00
..
2007-12-19 14:29:01 -08:00
2007-12-20 14:05:37 -08:00
2007-10-29 17:27:50 -04:00
2007-12-03 08:13:17 -08:00
2007-12-04 01:35:32 -05:00
2007-12-12 13:45:25 +01:00
2007-12-24 15:23:44 +01:00
2007-12-07 09:06:53 +00:00
2007-12-20 17:32:13 +00:00
2007-11-05 15:12:31 -08:00
2007-11-29 09:24:53 -08:00
2007-12-12 20:01:00 +01:00
2007-12-26 19:36:35 -08:00
2007-12-23 12:54:37 -08:00
2007-12-17 19:28:15 -08:00
2007-12-10 19:43:55 -08:00
2007-12-19 14:27:30 -08:00
2007-11-14 18:45:36 -08:00
2007-12-04 16:48:06 +00:00
2007-10-23 15:49:54 +10:00