Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/cpuidle: Replace __get_cpu_var uses for address calculation

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>

authored by

Christoph Lameter and committed by
Tejun Heo
229b6863 1b2a1a7e

+5 -5
+2 -2
drivers/cpuidle/governors/ladder.c
··· 66 66 static int ladder_select_state(struct cpuidle_driver *drv, 67 67 struct cpuidle_device *dev) 68 68 { 69 - struct ladder_device *ldev = &__get_cpu_var(ladder_devices); 69 + struct ladder_device *ldev = this_cpu_ptr(&ladder_devices); 70 70 struct ladder_device_state *last_state; 71 71 int last_residency, last_idx = ldev->last_state_idx; 72 72 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); ··· 170 170 */ 171 171 static void ladder_reflect(struct cpuidle_device *dev, int index) 172 172 { 173 - struct ladder_device *ldev = &__get_cpu_var(ladder_devices); 173 + struct ladder_device *ldev = this_cpu_ptr(&ladder_devices); 174 174 if (index > 0) 175 175 ldev->last_state_idx = index; 176 176 }
+3 -3
drivers/cpuidle/governors/menu.c
··· 289 289 */ 290 290 static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) 291 291 { 292 - struct menu_device *data = &__get_cpu_var(menu_devices); 292 + struct menu_device *data = this_cpu_ptr(&menu_devices); 293 293 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); 294 294 int i; 295 295 unsigned int interactivity_req; ··· 372 372 */ 373 373 static void menu_reflect(struct cpuidle_device *dev, int index) 374 374 { 375 - struct menu_device *data = &__get_cpu_var(menu_devices); 375 + struct menu_device *data = this_cpu_ptr(&menu_devices); 376 376 data->last_state_idx = index; 377 377 if (index >= 0) 378 378 data->needs_update = 1; ··· 385 385 */ 386 386 static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) 387 387 { 388 - struct menu_device *data = &__get_cpu_var(menu_devices); 388 + struct menu_device *data = this_cpu_ptr(&menu_devices); 389 389 int last_idx = data->last_state_idx; 390 390 struct cpuidle_state *target = &drv->states[last_idx]; 391 391 unsigned int measured_us;