aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/tsc_32.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c
index d78444c788a3..f04d08a7d022 100644
--- a/arch/x86/kernel/tsc_32.c
+++ b/arch/x86/kernel/tsc_32.c
@@ -131,7 +131,7 @@ unsigned long native_calculate_cpu_khz(void)
131{ 131{
132 unsigned long long start, end; 132 unsigned long long start, end;
133 unsigned long count; 133 unsigned long count;
134 u64 delta64; 134 u64 delta64 = (u64)ULLONG_MAX;
135 int i; 135 int i;
136 unsigned long flags; 136 unsigned long flags;
137 137
@@ -143,6 +143,7 @@ unsigned long native_calculate_cpu_khz(void)
143 rdtscll(start); 143 rdtscll(start);
144 mach_countup(&count); 144 mach_countup(&count);
145 rdtscll(end); 145 rdtscll(end);
146 delta64 = min(delta64, (end - start));
146 } 147 }
147 /* 148 /*
148 * Error: ECTCNEVERSET 149 * Error: ECTCNEVERSET
@@ -153,8 +154,6 @@ unsigned long native_calculate_cpu_khz(void)
153 if (count <= 1) 154 if (count <= 1)
154 goto err; 155 goto err;
155 156
156 delta64 = end - start;
157
158 /* cpu freq too fast: */ 157 /* cpu freq too fast: */
159 if (delta64 > (1ULL<<32)) 158 if (delta64 > (1ULL<<32))
160 goto err; 159 goto err;