summaryrefslogtreecommitdiff
path: root/lib/hexdump.c
diff options
context:
space:
mode:
authorYi Yang <yi.y.yang@intel.com>2007-12-27 22:04:26 -0500
committerLen Brown <len.brown@intel.com>2007-12-27 22:04:26 -0500
commit087980295082ccaa816330bc69c29a2ff53a244c (patch)
tree67a272391cd8c0060dddc2e1c99fdeaaedcd1eb7 /lib/hexdump.c
parentc68cb23dde29fb107575656effa46f7b9440ac04 (diff)
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>
Diffstat (limited to 'lib/hexdump.c')
0 files changed, 0 insertions, 0 deletions