Skip to content

Commit 229b686

Browse files
Christoph Lameterhtejun
authored andcommitted
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>
1 parent 1b2a1a7 commit 229b686

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/cpuidle/governors/ladder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static inline void ladder_do_selection(struct ladder_device *ldev,
6666
static int ladder_select_state(struct cpuidle_driver *drv,
6767
struct cpuidle_device *dev)
6868
{
69-
struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
69+
struct ladder_device *ldev = this_cpu_ptr(&ladder_devices);
7070
struct ladder_device_state *last_state;
7171
int last_residency, last_idx = ldev->last_state_idx;
7272
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
@@ -170,7 +170,7 @@ static int ladder_enable_device(struct cpuidle_driver *drv,
170170
*/
171171
static void ladder_reflect(struct cpuidle_device *dev, int index)
172172
{
173-
struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
173+
struct ladder_device *ldev = this_cpu_ptr(&ladder_devices);
174174
if (index > 0)
175175
ldev->last_state_idx = index;
176176
}

drivers/cpuidle/governors/menu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static void get_typical_interval(struct menu_device *data)
289289
*/
290290
static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
291291
{
292-
struct menu_device *data = &__get_cpu_var(menu_devices);
292+
struct menu_device *data = this_cpu_ptr(&menu_devices);
293293
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
294294
int i;
295295
unsigned int interactivity_req;
@@ -372,7 +372,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
372372
*/
373373
static void menu_reflect(struct cpuidle_device *dev, int index)
374374
{
375-
struct menu_device *data = &__get_cpu_var(menu_devices);
375+
struct menu_device *data = this_cpu_ptr(&menu_devices);
376376
data->last_state_idx = index;
377377
if (index >= 0)
378378
data->needs_update = 1;
@@ -385,7 +385,7 @@ static void menu_reflect(struct cpuidle_device *dev, int index)
385385
*/
386386
static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
387387
{
388-
struct menu_device *data = &__get_cpu_var(menu_devices);
388+
struct menu_device *data = this_cpu_ptr(&menu_devices);
389389
int last_idx = data->last_state_idx;
390390
struct cpuidle_state *target = &drv->states[last_idx];
391391
unsigned int measured_us;

0 commit comments

Comments
 (0)