summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2012-06-06 09:36:09 +0800
committerNitin Garg <nitin.garg@freescale.com>2014-06-03 21:53:42 -0500
commit4a4b113aed9b39d9af0bcec2fafd893e216eba19 (patch)
tree19162f3d28f549455b86695c8e09fd9a68804789 /init
parent55e08949b7bf4365fe9f2ca25ece3be0d9bea441 (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),