1
linux/drivers/acpi
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
..
dispatcher ACPICA: fix acpi-cpufreq boot crash due to _PSD return-by-reference 2007-12-02 14:26:55 -05:00
events
executer
hardware
namespace
parser
resources
sleep ACPI: /proc/acpi/alarm parsing: handle large numbers properly 2007-12-27 22:04:26 -05:00
tables ACPI: Add missing spaces to printk format 2007-11-19 21:53:32 -05:00
utilities
ac.c ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs. 2007-11-19 11:21:50 -05:00
acpi_memhotplug.c
asus_acpi.c
battery.c ACPI: battery: fix ACPI battery technology reporting 2007-12-06 22:29:22 -05:00
bay.c
blacklist.c
bus.c ACPI: Fan: Drop force_power_state acpi_device option 2007-10-25 16:31:31 -04:00
button.c ACPI: button: send initial lid state after add and resume 2007-10-25 16:31:30 -04:00
cm_sbs.c
container.c
debug.c
dock.c
ec.c Pull bugzilla-9327 into release branch 2007-11-20 20:07:49 -05:00
event.c
fan.c ACPI: Fan: Drop force_power_state acpi_device option 2007-10-25 16:31:31 -04:00
glue.c
Kconfig Revert "acpi: make ACPI_PROCFS default to y" 2007-11-19 11:22:44 -05:00
Makefile ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs. 2007-11-19 11:21:50 -05:00
numa.c ACPI: fix modpost warnings 2007-12-13 17:50:09 -05:00
osl.c ACPI: Handle I/O access width requestst that are not a multiple of 8 bits. 2007-11-16 21:37:14 -05:00
pci_bind.c ACPI: acpiphp: Remove dmesg spam on device remove 2007-11-20 19:06:04 -05:00
pci_irq.c
pci_link.c
pci_root.c
power.c ACPI: power: don't cache power resource state 2007-10-25 16:31:31 -04:00
processor_core.c ACPI: avoid references to impossible processors. 2007-11-29 09:24:55 -08:00
processor_idle.c ACPI: move timer broadcast before busmaster disable 2007-12-07 19:16:17 +01:00
processor_perflib.c
processor_thermal.c
processor_throttling.c ACPI: Delete the IRQ operation in throttling controll via PTC 2007-12-01 23:27:15 -05:00
sbs.c ACPI: SBS: Return rate in mW if capacity in mWh 2007-12-14 15:14:23 -05:00
sbshc.c ACPI: SBS: Ignore alarms coming from unknown devices 2007-12-14 15:14:06 -05:00
sbshc.h ACPI: SBS: Ignore alarms coming from unknown devices 2007-12-14 15:14:06 -05:00
scan.c
system.c
tables.c
thermal.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2007-10-19 13:12:46 -07:00
toshiba_acpi.c Fix Oops in toshiba_acpi error return path 2007-11-14 18:45:36 -08:00
utils.c
video.c ACPI: video_device_list corruption 2007-12-13 16:24:10 -05:00