diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2007-07-21 11:10:13 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-21 21:37:08 -0400 |
| commit | 7ff984785cf08e96bd46f7d9c7bf4d73f871599b (patch) | |
| tree | bd0056590524b01b30f50f08642247d6c32fc841 | |
| parent | ef81ab2c72e6979367612502fefbb18669e37879 (diff) | |
x86_64: Remove dead code and other janitor work in tsc.c
Remove unused code and variables and do some codingstyle / whitespace
cleanups while at it.
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | arch/x86_64/kernel/tsc.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/arch/x86_64/kernel/tsc.c b/arch/x86_64/kernel/tsc.c index e850aa01e1b3..9b76b03d0600 100644 --- a/arch/x86_64/kernel/tsc.c +++ b/arch/x86_64/kernel/tsc.c | |||
| @@ -61,25 +61,9 @@ inline int check_tsc_unstable(void) | |||
| 61 | * first tick after the change will be slightly wrong. | 61 | * first tick after the change will be slightly wrong. |
| 62 | */ | 62 | */ |
| 63 | 63 | ||
| 64 | #include <linux/workqueue.h> | 64 | static unsigned int ref_freq; |
| 65 | 65 | static unsigned long loops_per_jiffy_ref; | |
| 66 | static unsigned int cpufreq_delayed_issched = 0; | 66 | static unsigned long tsc_khz_ref; |
| 67 | static unsigned int cpufreq_init = 0; | ||
| 68 | static struct work_struct cpufreq_delayed_get_work; | ||
| 69 | |||
| 70 | static void handle_cpufreq_delayed_get(struct work_struct *v) | ||
| 71 | { | ||
| 72 | unsigned int cpu; | ||
| 73 | for_each_online_cpu(cpu) { | ||
| 74 | cpufreq_get(cpu); | ||
| 75 | } | ||
| 76 | cpufreq_delayed_issched = 0; | ||
| 77 | } | ||
| 78 | |||
| 79 | static unsigned int ref_freq = 0; | ||
| 80 | static unsigned long loops_per_jiffy_ref = 0; | ||
| 81 | |||
| 82 | static unsigned long tsc_khz_ref = 0; | ||
| 83 | 67 | ||
| 84 | static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | 68 | static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, |
| 85 | void *data) | 69 | void *data) |
| @@ -125,10 +109,8 @@ static struct notifier_block time_cpufreq_notifier_block = { | |||
| 125 | 109 | ||
| 126 | static int __init cpufreq_tsc(void) | 110 | static int __init cpufreq_tsc(void) |
| 127 | { | 111 | { |
| 128 | INIT_WORK(&cpufreq_delayed_get_work, handle_cpufreq_delayed_get); | 112 | cpufreq_register_notifier(&time_cpufreq_notifier_block, |
| 129 | if (!cpufreq_register_notifier(&time_cpufreq_notifier_block, | 113 | CPUFREQ_TRANSITION_NOTIFIER); |
| 130 | CPUFREQ_TRANSITION_NOTIFIER)) | ||
| 131 | cpufreq_init = 1; | ||
| 132 | return 0; | 114 | return 0; |
| 133 | } | 115 | } |
| 134 | 116 | ||
| @@ -153,17 +135,18 @@ __cpuinit int unsynchronized_tsc(void) | |||
| 153 | #endif | 135 | #endif |
| 154 | /* Most intel systems have synchronized TSCs except for | 136 | /* Most intel systems have synchronized TSCs except for |
| 155 | multi node systems */ | 137 | multi node systems */ |
| 156 | if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { | 138 | if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { |
| 157 | #ifdef CONFIG_ACPI | 139 | #ifdef CONFIG_ACPI |
| 158 | /* But TSC doesn't tick in C3 so don't use it there */ | 140 | /* But TSC doesn't tick in C3 so don't use it there */ |
| 159 | if (acpi_gbl_FADT.header.length > 0 && acpi_gbl_FADT.C3latency < 1000) | 141 | if (acpi_gbl_FADT.header.length > 0 && |
| 142 | acpi_gbl_FADT.C3latency < 1000) | ||
| 160 | return 1; | 143 | return 1; |
| 161 | #endif | 144 | #endif |
| 162 | return 0; | 145 | return 0; |
| 163 | } | 146 | } |
| 164 | 147 | ||
| 165 | /* Assume multi socket systems are not synchronized */ | 148 | /* Assume multi socket systems are not synchronized */ |
| 166 | return num_present_cpus() > 1; | 149 | return num_present_cpus() > 1; |
| 167 | } | 150 | } |
| 168 | 151 | ||
| 169 | int __init notsc_setup(char *s) | 152 | int __init notsc_setup(char *s) |
