diff options
author | Andi Kleen <ak@suse.de> | 2008-02-09 16:16:58 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 17:40:45 +0200 |
commit | b62576a2f53ad7edf604fedba0da1d4329749b7d (patch) | |
tree | 9a4a0fd20ef48b10d61d3dfd212649a601cd6a26 /arch | |
parent | 48c508b364324c35018284328b5b92c51d2b30e0 (diff) | |
download | kernel_samsung_crespo-b62576a2f53ad7edf604fedba0da1d4329749b7d.zip kernel_samsung_crespo-b62576a2f53ad7edf604fedba0da1d4329749b7d.tar.gz kernel_samsung_crespo-b62576a2f53ad7edf604fedba0da1d4329749b7d.tar.bz2 |
x86: use year 2000 offset for cmos clock
We know it is already after 2000. Use the year 2000 offset for both 32
and 64 bit, which removes ifdefs and the 1970 magic.
[ tglx@linutronix.de: remove 1970 magic, replace bogus commit message ]
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/rtc.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c index eb9b1a1..d256951 100644 --- a/arch/x86/kernel/rtc.c +++ b/arch/x86/kernel/rtc.c @@ -9,7 +9,6 @@ #include <asm/vsyscall.h> #ifdef CONFIG_X86_32 -# define CMOS_YEARS_OFFS 1900 /* * This is a special lock that is owned by the CPU and holds the index * register we are working with. It is required for NMI access to the @@ -17,14 +16,11 @@ */ volatile unsigned long cmos_lock = 0; EXPORT_SYMBOL(cmos_lock); -#else -/* - * x86-64 systems only exists since 2002. - * This will work up to Dec 31, 2100 - */ -# define CMOS_YEARS_OFFS 2000 #endif +/* For two digit years assume time is always after that */ +#define CMOS_YEARS_OFFS 2000 + DEFINE_SPINLOCK(rtc_lock); EXPORT_SYMBOL(rtc_lock); @@ -136,11 +132,8 @@ unsigned long mach_get_cmos_time(void) BCD_TO_BIN(century); year += century * 100; printk(KERN_INFO "Extended CMOS year: %d\n", century * 100); - } else { + } else year += CMOS_YEARS_OFFS; - if (year < 1970) - year += 100; - } return mktime(year, mon, day, hour, min, sec); } |