x86: fix TSC build error on 32bit
authorThomas Gleixner <tglx@linutronix.de>
Tue, 15 Jul 2008 20:08:04 +0000 (22:08 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 15 Jul 2008 20:46:47 +0000 (22:46 +0200)
Dave Hansen reported a build error on 32bit which went unnoticed
as newer gcc versions seem to optimize unused static functions
away before compiling them.

Make vread_tsc() depend on CONFIG_X86_64

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/tsc.c

index 3c36f92..7603c05 100644 (file)
@@ -358,6 +358,7 @@ static cycle_t read_tsc(void)
                ret : clocksource_tsc.cycle_last;
 }
 
+#ifdef CONFIG_X86_64
 static cycle_t __vsyscall_fn vread_tsc(void)
 {
        cycle_t ret = (cycle_t)vget_cycles();
@@ -365,6 +366,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
        return ret >= __vsyscall_gtod_data.clock.cycle_last ?
                ret : __vsyscall_gtod_data.clock.cycle_last;
 }
+#endif
 
 static struct clocksource clocksource_tsc = {
        .name                   = "tsc",