Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6.git] / init / calibrate.c
index 7963e3f..24fe022 100644 (file)
@@ -66,7 +66,7 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
                pre_start = 0;
                read_current_timer(&start);
                start_jiffies = jiffies;
-               while (jiffies <= (start_jiffies + 1)) {
+               while (time_before_eq(jiffies, start_jiffies + 1)) {
                        pre_start = start;
                        read_current_timer(&start);
                }
@@ -74,8 +74,8 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
 
                pre_end = 0;
                end = post_start;
-               while (jiffies <=
-                      (start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) {
+               while (time_before_eq(jiffies, start_jiffies + 1 +
+                                              DELAY_CALIBRATION_TICKS)) {
                        pre_end = end;
                        read_current_timer(&end);
                }
@@ -123,23 +123,26 @@ void __cpuinit calibrate_delay(void)
 {
        unsigned long ticks, loopbit;
        int lps_precision = LPS_PREC;
+       static bool printed;
 
        if (preset_lpj) {
                loops_per_jiffy = preset_lpj;
-               printk(KERN_INFO
-                       "Calibrating delay loop (skipped) preset value.. ");
-       } else if ((smp_processor_id() == 0) && lpj_fine) {
+               if (!printed)
+                       pr_info("Calibrating delay loop (skipped) "
+                               "preset value.. ");
+       } else if ((!printed) && lpj_fine) {
                loops_per_jiffy = lpj_fine;
-               printk(KERN_INFO
-                       "Calibrating delay loop (skipped), "
+               pr_info("Calibrating delay loop (skipped), "
                        "value calculated using timer frequency.. ");
        } else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
-               printk(KERN_INFO
-                       "Calibrating delay using timer specific routine.. ");
+               if (!printed)
+                       pr_info("Calibrating delay using timer "
+                               "specific routine.. ");
        } else {
                loops_per_jiffy = (1<<12);
 
-               printk(KERN_INFO "Calibrating delay loop... ");
+               if (!printed)
+                       pr_info("Calibrating delay loop... ");
                while ((loops_per_jiffy <<= 1) != 0) {
                        /* wait for "start of" clock tick */
                        ticks = jiffies;
@@ -170,7 +173,10 @@ void __cpuinit calibrate_delay(void)
                                loops_per_jiffy &= ~loopbit;
                }
        }
-       printk(KERN_INFO "%lu.%02lu BogoMIPS (lpj=%lu)\n",
+       if (!printed)
+               pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
                        loops_per_jiffy/(500000/HZ),
                        (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
+
+       printed = true;
 }