summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2012-06-06 09:36:09 +0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:38:27 +0800
commit08d47ad147b51f18418f180845247a380f076347 (patch)
tree63f1d9f8b30182b85b42a31f56129d102b395094 /init
parent647445e489e589dffdf321c2cd0ac13d373c01af (diff)
ENGR00212490 [SMP]Fix build error of calibrate when no define SMP
Fix build error, only under SMP enviroment, we use per_cpu cpu_data to decide to redo calibrate delay or skip. Signed-off-by: Anson Huang <b20788@freescale.com>
Diffstat (limited to 'init')
-rw-r--r--init/calibrate.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/init/calibrate.c b/init/calibrate.c
index ebab7b344a65..a4f57ff1efbd 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -249,13 +249,16 @@ void __cpuinit calibrate_delay(void)
{
unsigned long lpj;
static bool printed;
+#ifdef CONFIG_SMP
int this_cpu = smp_processor_id();
-
if (per_cpu(cpu_data, this_cpu).loops_per_jiffy) {
lpj = per_cpu(cpu_data, this_cpu).loops_per_jiffy;
pr_info("Calibrating delay loop (skipped) "
"already calibrated this CPU");
} else if (preset_lpj) {
+#else
+ if (preset_lpj) {
+#endif
lpj = preset_lpj;
if (!printed)
pr_info("Calibrating delay loop (skipped) "
@@ -273,7 +276,9 @@ void __cpuinit calibrate_delay(void)
pr_info("Calibrating delay loop... ");
lpj = calibrate_delay_converge();
}
+#ifdef CONFIG_SMP
per_cpu(cpu_data, this_cpu).loops_per_jiffy = lpj;
+#endif
if (!printed)
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
lpj/(500000/HZ),