drivers/cpuidle: Replace __get_cpu_var uses for address calculation
authorChristoph Lameter <cl@linux.com>
Sun, 17 Aug 2014 17:30:30 +0000 (12:30 -0500)
committerTejun Heo <tj@kernel.org>
Tue, 26 Aug 2014 17:45:45 +0000 (13:45 -0400)
All of these are for address calculation. Replace with
this_cpu_ptr().

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-pm@vger.kernel.org
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
[cpufreq changes]
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/cpuidle/governors/ladder.c
drivers/cpuidle/governors/menu.c

index 044ee0df5871949b8c1e0c0c744b4db068d4ba57..06b57c4c4d80debb885002bb48b7c318c5dbd5ec 100644 (file)
@@ -66,7 +66,7 @@ static inline void ladder_do_selection(struct ladder_device *ldev,
 static int ladder_select_state(struct cpuidle_driver *drv,
                                struct cpuidle_device *dev)
 {
-       struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
+       struct ladder_device *ldev = this_cpu_ptr(&ladder_devices);
        struct ladder_device_state *last_state;
        int last_residency, last_idx = ldev->last_state_idx;
        int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
@@ -170,7 +170,7 @@ static int ladder_enable_device(struct cpuidle_driver *drv,
  */
 static void ladder_reflect(struct cpuidle_device *dev, int index)
 {
-       struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
+       struct ladder_device *ldev = this_cpu_ptr(&ladder_devices);
        if (index > 0)
                ldev->last_state_idx = index;
 }
index 34db2fb3ef1eb5ef17a2fb47ae5cd820e240c9e5..710a233b9b0d6e2fa0a3f06543283bde1cb885ee 100644 (file)
@@ -289,7 +289,7 @@ again:
  */
 static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 {
-       struct menu_device *data = &__get_cpu_var(menu_devices);
+       struct menu_device *data = this_cpu_ptr(&menu_devices);
        int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
        int i;
        unsigned int interactivity_req;
@@ -372,7 +372,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
  */
 static void menu_reflect(struct cpuidle_device *dev, int index)
 {
-       struct menu_device *data = &__get_cpu_var(menu_devices);
+       struct menu_device *data = this_cpu_ptr(&menu_devices);
        data->last_state_idx = index;
        if (index >= 0)
                data->needs_update = 1;
@@ -385,7 +385,7 @@ static void menu_reflect(struct cpuidle_device *dev, int index)
  */
 static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 {
-       struct menu_device *data = &__get_cpu_var(menu_devices);
+       struct menu_device *data = this_cpu_ptr(&menu_devices);
        int last_idx = data->last_state_idx;
        struct cpuidle_state *target = &drv->states[last_idx];
        unsigned int measured_us;