ARM: tegra11x: Remove redundant cpu_number calls
Bo Yan [Thu, 7 Feb 2013 00:30:50 +0000 (16:30 -0800)]
The "cpu_number" maps cpu number for slow cluster to "4", this can
be reused later, no need to call "cpu_number" every time.

Change-Id: Ib0636b80b587868e23a6b07a5cc9960e13d38353
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/198580
(cherry picked from commit 79faef4783ff207f38d76c283704e3b70ea31f18)
Reviewed-on: http://git-master/r/200853
GVS: Gerrit_Virtual_Submit
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

arch/arm/mach-tegra/cpuidle-t11x.c

index 517a955..6eea8f3 100644 (file)
@@ -375,9 +375,7 @@ static bool tegra_cpu_core_power_down(struct cpuidle_device *dev,
        struct arch_timer_context timer_context;
        bool sleep_completed = false;
        struct tick_sched *ts = tick_get_tick_sched(dev->cpu);
-#ifdef CONFIG_TRUSTED_FOUNDATIONS
        unsigned int cpu = cpu_number(dev->cpu);
-#endif
 
        if (!arch_timer_get_state(&timer_context)) {
                if ((timer_context.cntp_ctl & ARCH_TIMER_CTRL_ENABLE) &&
@@ -418,7 +416,7 @@ static bool tegra_cpu_core_power_down(struct cpuidle_device *dev,
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
        tegra_pd_set_trigger(sleep_time);
 #endif
-       idle_stats.tear_down_count[cpu_number(dev->cpu)]++;
+       idle_stats.tear_down_count[cpu]++;
 
        entry_time = ktime_get();
 
@@ -446,17 +444,17 @@ static bool tegra_cpu_core_power_down(struct cpuidle_device *dev,
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
 #endif
        sleep_time = ktime_to_us(ktime_sub(ktime_get(), entry_time));
-       idle_stats.cpu_pg_time[cpu_number(dev->cpu)] += sleep_time;
+       idle_stats.cpu_pg_time[cpu] += sleep_time;
        if (sleep_completed) {
                /*
                 * Stayed in LP2 for the full time until timer expires,
                 * adjust the exit latency based on measurement
                 */
                int offset = sleep_time - request;
-               int latency = pd_exit_latencies[cpu_number(dev->cpu)] +
+               int latency = pd_exit_latencies[cpu] +
                        offset / 16;
                latency = clamp(latency, 0, 10000);
-               pd_exit_latencies[cpu_number(dev->cpu)] = latency;
+               pd_exit_latencies[cpu] = latency;
                state->exit_latency = latency;          /* for idle governor */
                smp_wmb();
        }