aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
commit0429fbc0bdc297d64188483ba029a23773ae07b0 (patch)
tree67de46978c90f37540dd6ded1db20eb53a569030 /drivers
parent6929c358972facf2999f8768815c40dd88514fc2 (diff)
parent513d1a2884a49654f368b5fa25ef186e976bdada (diff)
Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Pull percpu consistent-ops changes from Tejun Heo: "Way back, before the current percpu allocator was implemented, static and dynamic percpu memory areas were allocated and handled separately and had their own accessors. The distinction has been gone for many years now; however, the now duplicate two sets of accessors remained with the pointer based ones - this_cpu_*() - evolving various other operations over time. During the process, we also accumulated other inconsistent operations. This pull request contains Christoph's patches to clean up the duplicate accessor situation. __get_cpu_var() uses are replaced with with this_cpu_ptr() and __this_cpu_ptr() with raw_cpu_ptr(). Unfortunately, the former sometimes is tricky thanks to C being a bit messy with the distinction between lvalues and pointers, which led to a rather ugly solution for cpumask_var_t involving the introduction of this_cpu_cpumask_var_ptr(). This converts most of the uses but not all. Christoph will follow up with the remaining conversions in this merge window and hopefully remove the obsolete accessors" * 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (38 commits) irqchip: Properly fetch the per cpu offset percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t -fix ia64: sn_nodepda cannot be assigned to after this_cpu conversion. Use __this_cpu_write. percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t Revert "powerpc: Replace __get_cpu_var uses" percpu: Remove __this_cpu_ptr clocksource: Replace __this_cpu_ptr with raw_cpu_ptr sparc: Replace __get_cpu_var uses avr32: Replace __get_cpu_var with __this_cpu_write blackfin: Replace __get_cpu_var uses tile: Use this_cpu_ptr() for hardware counters tile: Replace __get_cpu_var uses powerpc: Replace __get_cpu_var uses alpha: Replace __get_cpu_var ia64: Replace __get_cpu_var uses s390: cio driver &__get_cpu_var replacements s390: Replace __get_cpu_var uses mips: Replace __get_cpu_var uses MIPS: Replace __get_cpu_var uses in FPU emulator. arm: Replace __this_cpu_ptr with raw_cpu_ptr ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/random.c2
-rw-r--r--drivers/clocksource/dummy_timer.c2
-rw-r--r--drivers/clocksource/metag_generic.c2
-rw-r--r--drivers/clocksource/qcom-timer.c2
-rw-r--r--drivers/cpuidle/governors/ladder.c4
-rw-r--r--drivers/cpuidle/governors/menu.c6
-rw-r--r--drivers/irqchip/irq-gic.c10
-rw-r--r--drivers/md/dm-stats.c2
-rw-r--r--drivers/net/ethernet/tile/tilegx.c22
-rw-r--r--drivers/net/ethernet/tile/tilepro.c8
-rw-r--r--drivers/oprofile/cpu_buffer.c10
-rw-r--r--drivers/oprofile/timer_int.c2
-rw-r--r--drivers/s390/cio/ccwreq.c2
-rw-r--r--drivers/s390/cio/chsc_sch.c2
-rw-r--r--drivers/s390/cio/cio.c6
-rw-r--r--drivers/s390/cio/device_fsm.c4
-rw-r--r--drivers/s390/cio/eadm_sch.c2
17 files changed, 44 insertions, 44 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index c18d41db83d8..82759cef9043 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -874,7 +874,7 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
874void add_interrupt_randomness(int irq, int irq_flags) 874void add_interrupt_randomness(int irq, int irq_flags)
875{ 875{
876 struct entropy_store *r; 876 struct entropy_store *r;
877 struct fast_pool *fast_pool = &__get_cpu_var(irq_randomness); 877 struct fast_pool *fast_pool = this_cpu_ptr(&irq_randomness);
878 struct pt_regs *regs = get_irq_regs(); 878 struct pt_regs *regs = get_irq_regs();
879 unsigned long now = jiffies; 879 unsigned long now = jiffies;
880 cycles_t cycles = random_get_entropy(); 880 cycles_t cycles = random_get_entropy();
diff --git a/drivers/clocksource/dummy_timer.c b/drivers/clocksource/dummy_timer.c
index ad3572541728..31990600fcff 100644
--- a/drivers/clocksource/dummy_timer.c
+++ b/drivers/clocksource/dummy_timer.c
@@ -28,7 +28,7 @@ static void dummy_timer_set_mode(enum clock_event_mode mode,
28static void dummy_timer_setup(void) 28static void dummy_timer_setup(void)
29{ 29{
30 int cpu = smp_processor_id(); 30 int cpu = smp_processor_id();
31 struct clock_event_device *evt = __this_cpu_ptr(&dummy_timer_evt); 31 struct clock_event_device *evt = raw_cpu_ptr(&dummy_timer_evt);
32 32
33 evt->name = "dummy_timer"; 33 evt->name = "dummy_timer";
34 evt->features = CLOCK_EVT_FEAT_PERIODIC | 34 evt->features = CLOCK_EVT_FEAT_PERIODIC |
diff --git a/drivers/clocksource/metag_generic.c b/drivers/clocksource/metag_generic.c
index 9e4db41abe3c..b7384b853e5a 100644
--- a/drivers/clocksource/metag_generic.c
+++ b/drivers/clocksource/metag_generic.c
@@ -90,7 +90,7 @@ static struct clocksource clocksource_metag = {
90 90
91static irqreturn_t metag_timer_interrupt(int irq, void *dummy) 91static irqreturn_t metag_timer_interrupt(int irq, void *dummy)
92{ 92{
93 struct clock_event_device *evt = &__get_cpu_var(local_clockevent); 93 struct clock_event_device *evt = this_cpu_ptr(&local_clockevent);
94 94
95 evt->event_handler(evt); 95 evt->event_handler(evt);
96 96
diff --git a/drivers/clocksource/qcom-timer.c b/drivers/clocksource/qcom-timer.c
index 8d115db1e651..098c542e5c53 100644
--- a/drivers/clocksource/qcom-timer.c
+++ b/drivers/clocksource/qcom-timer.c
@@ -219,7 +219,7 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
219 } 219 }
220 220
221 /* Immediately configure the timer on the boot CPU */ 221 /* Immediately configure the timer on the boot CPU */
222 msm_local_timer_setup(__this_cpu_ptr(msm_evt)); 222 msm_local_timer_setup(raw_cpu_ptr(msm_evt));
223 } 223 }
224 224
225err: 225err:
diff --git a/drivers/cpuidle/governors/ladder.c b/drivers/cpuidle/governors/ladder.c
index 044ee0df5871..06b57c4c4d80 100644
--- a/drivers/cpuidle/governors/ladder.c
+++ b/drivers/cpuidle/governors/ladder.c
@@ -66,7 +66,7 @@ static inline void ladder_do_selection(struct ladder_device *ldev,
66static int ladder_select_state(struct cpuidle_driver *drv, 66static int ladder_select_state(struct cpuidle_driver *drv,
67 struct cpuidle_device *dev) 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 struct ladder_device_state *last_state; 70 struct ladder_device_state *last_state;
71 int last_residency, last_idx = ldev->last_state_idx; 71 int last_residency, last_idx = ldev->last_state_idx;
72 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); 72 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
@@ -170,7 +170,7 @@ static int ladder_enable_device(struct cpuidle_driver *drv,
170 */ 170 */
171static void ladder_reflect(struct cpuidle_device *dev, int index) 171static 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 if (index > 0) 174 if (index > 0)
175 ldev->last_state_idx = index; 175 ldev->last_state_idx = index;
176} 176}
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 34db2fb3ef1e..710a233b9b0d 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -289,7 +289,7 @@ again:
289 */ 289 */
290static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev) 290static 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 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY); 293 int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
294 int i; 294 int i;
295 unsigned int interactivity_req; 295 unsigned int interactivity_req;
@@ -372,7 +372,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
372 */ 372 */
373static void menu_reflect(struct cpuidle_device *dev, int index) 373static 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 data->last_state_idx = index; 376 data->last_state_idx = index;
377 if (index >= 0) 377 if (index >= 0)
378 data->needs_update = 1; 378 data->needs_update = 1;
@@ -385,7 +385,7 @@ static void menu_reflect(struct cpuidle_device *dev, int index)
385 */ 385 */
386static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) 386static 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 int last_idx = data->last_state_idx; 389 int last_idx = data->last_state_idx;
390 struct cpuidle_state *target = &drv->states[last_idx]; 390 struct cpuidle_state *target = &drv->states[last_idx];
391 unsigned int measured_us; 391 unsigned int measured_us;
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index f0a4800a15b0..38493ff28fa5 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -102,7 +102,7 @@ static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly;
102#ifdef CONFIG_GIC_NON_BANKED 102#ifdef CONFIG_GIC_NON_BANKED
103static void __iomem *gic_get_percpu_base(union gic_base *base) 103static void __iomem *gic_get_percpu_base(union gic_base *base)
104{ 104{
105 return *__this_cpu_ptr(base->percpu_base); 105 return raw_cpu_read(*base->percpu_base);
106} 106}
107 107
108static void __iomem *gic_get_common_base(union gic_base *base) 108static void __iomem *gic_get_common_base(union gic_base *base)
@@ -522,11 +522,11 @@ static void gic_cpu_save(unsigned int gic_nr)
522 if (!dist_base || !cpu_base) 522 if (!dist_base || !cpu_base)
523 return; 523 return;
524 524
525 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable); 525 ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
526 for (i = 0; i < DIV_ROUND_UP(32, 32); i++) 526 for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
527 ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4); 527 ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
528 528
529 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf); 529 ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
530 for (i = 0; i < DIV_ROUND_UP(32, 16); i++) 530 for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
531 ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4); 531 ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
532 532
@@ -548,11 +548,11 @@ static void gic_cpu_restore(unsigned int gic_nr)
548 if (!dist_base || !cpu_base) 548 if (!dist_base || !cpu_base)
549 return; 549 return;
550 550
551 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable); 551 ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
552 for (i = 0; i < DIV_ROUND_UP(32, 32); i++) 552 for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
553 writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4); 553 writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);
554 554
555 ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf); 555 ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
556 for (i = 0; i < DIV_ROUND_UP(32, 16); i++) 556 for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
557 writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4); 557 writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);
558 558
diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c
index 28a90122a5a8..87f86c77b094 100644
--- a/drivers/md/dm-stats.c
+++ b/drivers/md/dm-stats.c
@@ -548,7 +548,7 @@ void dm_stats_account_io(struct dm_stats *stats, unsigned long bi_rw,
548 * A race condition can at worst result in the merged flag being 548 * A race condition can at worst result in the merged flag being
549 * misrepresented, so we don't have to disable preemption here. 549 * misrepresented, so we don't have to disable preemption here.
550 */ 550 */
551 last = __this_cpu_ptr(stats->last); 551 last = raw_cpu_ptr(stats->last);
552 stats_aux->merged = 552 stats_aux->merged =
553 (bi_sector == (ACCESS_ONCE(last->last_sector) && 553 (bi_sector == (ACCESS_ONCE(last->last_sector) &&
554 ((bi_rw & (REQ_WRITE | REQ_DISCARD)) == 554 ((bi_rw & (REQ_WRITE | REQ_DISCARD)) ==
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index 69557a26f749..049747f558c9 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -423,7 +423,7 @@ static void tile_net_pop_all_buffers(int instance, int stack)
423/* Provide linux buffers to mPIPE. */ 423/* Provide linux buffers to mPIPE. */
424static void tile_net_provide_needed_buffers(void) 424static void tile_net_provide_needed_buffers(void)
425{ 425{
426 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 426 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
427 int instance, kind; 427 int instance, kind;
428 for (instance = 0; instance < NR_MPIPE_MAX && 428 for (instance = 0; instance < NR_MPIPE_MAX &&
429 info->mpipe[instance].has_iqueue; instance++) { 429 info->mpipe[instance].has_iqueue; instance++) {
@@ -551,7 +551,7 @@ static inline bool filter_packet(struct net_device *dev, void *buf)
551static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb, 551static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb,
552 gxio_mpipe_idesc_t *idesc, unsigned long len) 552 gxio_mpipe_idesc_t *idesc, unsigned long len)
553{ 553{
554 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 554 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
555 struct tile_net_priv *priv = netdev_priv(dev); 555 struct tile_net_priv *priv = netdev_priv(dev);
556 int instance = priv->instance; 556 int instance = priv->instance;
557 557
@@ -585,7 +585,7 @@ static void tile_net_receive_skb(struct net_device *dev, struct sk_buff *skb,
585/* Handle a packet. Return true if "processed", false if "filtered". */ 585/* Handle a packet. Return true if "processed", false if "filtered". */
586static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc) 586static bool tile_net_handle_packet(int instance, gxio_mpipe_idesc_t *idesc)
587{ 587{
588 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 588 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
589 struct mpipe_data *md = &mpipe_data[instance]; 589 struct mpipe_data *md = &mpipe_data[instance];
590 struct net_device *dev = md->tile_net_devs_for_channel[idesc->channel]; 590 struct net_device *dev = md->tile_net_devs_for_channel[idesc->channel];
591 uint8_t l2_offset; 591 uint8_t l2_offset;
@@ -651,7 +651,7 @@ drop:
651 */ 651 */
652static int tile_net_poll(struct napi_struct *napi, int budget) 652static int tile_net_poll(struct napi_struct *napi, int budget)
653{ 653{
654 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 654 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
655 unsigned int work = 0; 655 unsigned int work = 0;
656 gxio_mpipe_idesc_t *idesc; 656 gxio_mpipe_idesc_t *idesc;
657 int instance, i, n; 657 int instance, i, n;
@@ -700,7 +700,7 @@ done:
700/* Handle an ingress interrupt from an instance on the current cpu. */ 700/* Handle an ingress interrupt from an instance on the current cpu. */
701static irqreturn_t tile_net_handle_ingress_irq(int irq, void *id) 701static irqreturn_t tile_net_handle_ingress_irq(int irq, void *id)
702{ 702{
703 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 703 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
704 napi_schedule(&info->mpipe[(uint64_t)id].napi); 704 napi_schedule(&info->mpipe[(uint64_t)id].napi);
705 return IRQ_HANDLED; 705 return IRQ_HANDLED;
706} 706}
@@ -763,7 +763,7 @@ static enum hrtimer_restart tile_net_handle_tx_wake_timer(struct hrtimer *t)
763/* Make sure the egress timer is scheduled. */ 763/* Make sure the egress timer is scheduled. */
764static void tile_net_schedule_egress_timer(void) 764static void tile_net_schedule_egress_timer(void)
765{ 765{
766 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 766 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
767 767
768 if (!info->egress_timer_scheduled) { 768 if (!info->egress_timer_scheduled) {
769 hrtimer_start(&info->egress_timer, 769 hrtimer_start(&info->egress_timer,
@@ -780,7 +780,7 @@ static void tile_net_schedule_egress_timer(void)
780 */ 780 */
781static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t) 781static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t)
782{ 782{
783 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 783 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
784 unsigned long irqflags; 784 unsigned long irqflags;
785 bool pending = false; 785 bool pending = false;
786 int i, instance; 786 int i, instance;
@@ -1927,7 +1927,7 @@ static void tso_egress(struct net_device *dev, gxio_mpipe_equeue_t *equeue,
1927 */ 1927 */
1928static int tile_net_tx_tso(struct sk_buff *skb, struct net_device *dev) 1928static int tile_net_tx_tso(struct sk_buff *skb, struct net_device *dev)
1929{ 1929{
1930 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 1930 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
1931 struct tile_net_priv *priv = netdev_priv(dev); 1931 struct tile_net_priv *priv = netdev_priv(dev);
1932 int channel = priv->echannel; 1932 int channel = priv->echannel;
1933 int instance = priv->instance; 1933 int instance = priv->instance;
@@ -1996,7 +1996,7 @@ static unsigned int tile_net_tx_frags(struct frag *frags,
1996/* Help the kernel transmit a packet. */ 1996/* Help the kernel transmit a packet. */
1997static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) 1997static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
1998{ 1998{
1999 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 1999 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
2000 struct tile_net_priv *priv = netdev_priv(dev); 2000 struct tile_net_priv *priv = netdev_priv(dev);
2001 int instance = priv->instance; 2001 int instance = priv->instance;
2002 struct mpipe_data *md = &mpipe_data[instance]; 2002 struct mpipe_data *md = &mpipe_data[instance];
@@ -2138,7 +2138,7 @@ static int tile_net_set_mac_address(struct net_device *dev, void *p)
2138static void tile_net_netpoll(struct net_device *dev) 2138static void tile_net_netpoll(struct net_device *dev)
2139{ 2139{
2140 int instance = mpipe_instance(dev); 2140 int instance = mpipe_instance(dev);
2141 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 2141 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
2142 struct mpipe_data *md = &mpipe_data[instance]; 2142 struct mpipe_data *md = &mpipe_data[instance];
2143 2143
2144 disable_percpu_irq(md->ingress_irq); 2144 disable_percpu_irq(md->ingress_irq);
@@ -2237,7 +2237,7 @@ static void tile_net_dev_init(const char *name, const uint8_t *mac)
2237/* Per-cpu module initialization. */ 2237/* Per-cpu module initialization. */
2238static void tile_net_init_module_percpu(void *unused) 2238static void tile_net_init_module_percpu(void *unused)
2239{ 2239{
2240 struct tile_net_info *info = &__get_cpu_var(per_cpu_info); 2240 struct tile_net_info *info = this_cpu_ptr(&per_cpu_info);
2241 int my_cpu = smp_processor_id(); 2241 int my_cpu = smp_processor_id();
2242 int instance; 2242 int instance;
2243 2243
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c
index 88818d5054ab..fb12d31cfcf6 100644
--- a/drivers/net/ethernet/tile/tilepro.c
+++ b/drivers/net/ethernet/tile/tilepro.c
@@ -996,13 +996,13 @@ static void tile_net_register(void *dev_ptr)
996 PDEBUG("tile_net_register(queue_id %d)\n", queue_id); 996 PDEBUG("tile_net_register(queue_id %d)\n", queue_id);
997 997
998 if (!strcmp(dev->name, "xgbe0")) 998 if (!strcmp(dev->name, "xgbe0"))
999 info = &__get_cpu_var(hv_xgbe0); 999 info = this_cpu_ptr(&hv_xgbe0);
1000 else if (!strcmp(dev->name, "xgbe1")) 1000 else if (!strcmp(dev->name, "xgbe1"))
1001 info = &__get_cpu_var(hv_xgbe1); 1001 info = this_cpu_ptr(&hv_xgbe1);
1002 else if (!strcmp(dev->name, "gbe0")) 1002 else if (!strcmp(dev->name, "gbe0"))
1003 info = &__get_cpu_var(hv_gbe0); 1003 info = this_cpu_ptr(&hv_gbe0);
1004 else if (!strcmp(dev->name, "gbe1")) 1004 else if (!strcmp(dev->name, "gbe1"))
1005 info = &__get_cpu_var(hv_gbe1); 1005 info = this_cpu_ptr(&hv_gbe1);
1006 else 1006 else
1007 BUG(); 1007 BUG();
1008 1008
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index 8aa73fac6ad4..0581461c3a67 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -45,7 +45,7 @@ unsigned long oprofile_get_cpu_buffer_size(void)
45 45
46void oprofile_cpu_buffer_inc_smpl_lost(void) 46void oprofile_cpu_buffer_inc_smpl_lost(void)
47{ 47{
48 struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 48 struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
49 49
50 cpu_buf->sample_lost_overflow++; 50 cpu_buf->sample_lost_overflow++;
51} 51}
@@ -297,7 +297,7 @@ __oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
297 unsigned long event, int is_kernel, 297 unsigned long event, int is_kernel,
298 struct task_struct *task) 298 struct task_struct *task)
299{ 299{
300 struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 300 struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
301 unsigned long backtrace = oprofile_backtrace_depth; 301 unsigned long backtrace = oprofile_backtrace_depth;
302 302
303 /* 303 /*
@@ -357,7 +357,7 @@ oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs,
357{ 357{
358 struct op_sample *sample; 358 struct op_sample *sample;
359 int is_kernel = !user_mode(regs); 359 int is_kernel = !user_mode(regs);
360 struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 360 struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
361 361
362 cpu_buf->sample_received++; 362 cpu_buf->sample_received++;
363 363
@@ -412,13 +412,13 @@ int oprofile_write_commit(struct op_entry *entry)
412 412
413void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event) 413void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event)
414{ 414{
415 struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 415 struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
416 log_sample(cpu_buf, pc, 0, is_kernel, event, NULL); 416 log_sample(cpu_buf, pc, 0, is_kernel, event, NULL);
417} 417}
418 418
419void oprofile_add_trace(unsigned long pc) 419void oprofile_add_trace(unsigned long pc)
420{ 420{
421 struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 421 struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
422 422
423 if (!cpu_buf->tracing) 423 if (!cpu_buf->tracing)
424 return; 424 return;
diff --git a/drivers/oprofile/timer_int.c b/drivers/oprofile/timer_int.c
index 61be1d9c16c8..bdef916e5dda 100644
--- a/drivers/oprofile/timer_int.c
+++ b/drivers/oprofile/timer_int.c
@@ -32,7 +32,7 @@ static enum hrtimer_restart oprofile_hrtimer_notify(struct hrtimer *hrtimer)
32 32
33static void __oprofile_hrtimer_start(void *unused) 33static void __oprofile_hrtimer_start(void *unused)
34{ 34{
35 struct hrtimer *hrtimer = &__get_cpu_var(oprofile_hrtimer); 35 struct hrtimer *hrtimer = this_cpu_ptr(&oprofile_hrtimer);
36 36
37 if (!ctr_running) 37 if (!ctr_running)
38 return; 38 return;
diff --git a/drivers/s390/cio/ccwreq.c b/drivers/s390/cio/ccwreq.c
index 07676c22d514..79f59915f71b 100644
--- a/drivers/s390/cio/ccwreq.c
+++ b/drivers/s390/cio/ccwreq.c
@@ -252,7 +252,7 @@ static void ccwreq_log_status(struct ccw_device *cdev, enum io_status status)
252 */ 252 */
253void ccw_request_handler(struct ccw_device *cdev) 253void ccw_request_handler(struct ccw_device *cdev)
254{ 254{
255 struct irb *irb = &__get_cpu_var(cio_irb); 255 struct irb *irb = this_cpu_ptr(&cio_irb);
256 struct ccw_request *req = &cdev->private->req; 256 struct ccw_request *req = &cdev->private->req;
257 enum io_status status; 257 enum io_status status;
258 int rc = -EOPNOTSUPP; 258 int rc = -EOPNOTSUPP;
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 3d22d2a4ce14..213159dec89e 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -58,7 +58,7 @@ static void chsc_subchannel_irq(struct subchannel *sch)
58{ 58{
59 struct chsc_private *private = dev_get_drvdata(&sch->dev); 59 struct chsc_private *private = dev_get_drvdata(&sch->dev);
60 struct chsc_request *request = private->request; 60 struct chsc_request *request = private->request;
61 struct irb *irb = &__get_cpu_var(cio_irb); 61 struct irb *irb = this_cpu_ptr(&cio_irb);
62 62
63 CHSC_LOG(4, "irb"); 63 CHSC_LOG(4, "irb");
64 CHSC_LOG_HEX(4, irb, sizeof(*irb)); 64 CHSC_LOG_HEX(4, irb, sizeof(*irb));
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index d5a6f287d2fe..10eb738fc81a 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -563,7 +563,7 @@ static irqreturn_t do_cio_interrupt(int irq, void *dummy)
563 563
564 set_cpu_flag(CIF_NOHZ_DELAY); 564 set_cpu_flag(CIF_NOHZ_DELAY);
565 tpi_info = (struct tpi_info *) &get_irq_regs()->int_code; 565 tpi_info = (struct tpi_info *) &get_irq_regs()->int_code;
566 irb = &__get_cpu_var(cio_irb); 566 irb = this_cpu_ptr(&cio_irb);
567 sch = (struct subchannel *)(unsigned long) tpi_info->intparm; 567 sch = (struct subchannel *)(unsigned long) tpi_info->intparm;
568 if (!sch) { 568 if (!sch) {
569 /* Clear pending interrupt condition. */ 569 /* Clear pending interrupt condition. */
@@ -613,7 +613,7 @@ void cio_tsch(struct subchannel *sch)
613 struct irb *irb; 613 struct irb *irb;
614 int irq_context; 614 int irq_context;
615 615
616 irb = &__get_cpu_var(cio_irb); 616 irb = this_cpu_ptr(&cio_irb);
617 /* Store interrupt response block to lowcore. */ 617 /* Store interrupt response block to lowcore. */
618 if (tsch(sch->schid, irb) != 0) 618 if (tsch(sch->schid, irb) != 0)
619 /* Not status pending or not operational. */ 619 /* Not status pending or not operational. */
@@ -751,7 +751,7 @@ __clear_io_subchannel_easy(struct subchannel_id schid)
751 struct tpi_info ti; 751 struct tpi_info ti;
752 752
753 if (tpi(&ti)) { 753 if (tpi(&ti)) {
754 tsch(ti.schid, &__get_cpu_var(cio_irb)); 754 tsch(ti.schid, this_cpu_ptr(&cio_irb));
755 if (schid_equal(&ti.schid, &schid)) 755 if (schid_equal(&ti.schid, &schid))
756 return 0; 756 return 0;
757 } 757 }
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 0bc902b3cd84..83da53c8e54c 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -739,7 +739,7 @@ ccw_device_irq(struct ccw_device *cdev, enum dev_event dev_event)
739 struct irb *irb; 739 struct irb *irb;
740 int is_cmd; 740 int is_cmd;
741 741
742 irb = &__get_cpu_var(cio_irb); 742 irb = this_cpu_ptr(&cio_irb);
743 is_cmd = !scsw_is_tm(&irb->scsw); 743 is_cmd = !scsw_is_tm(&irb->scsw);
744 /* Check for unsolicited interrupt. */ 744 /* Check for unsolicited interrupt. */
745 if (!scsw_is_solicited(&irb->scsw)) { 745 if (!scsw_is_solicited(&irb->scsw)) {
@@ -805,7 +805,7 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event)
805{ 805{
806 struct irb *irb; 806 struct irb *irb;
807 807
808 irb = &__get_cpu_var(cio_irb); 808 irb = this_cpu_ptr(&cio_irb);
809 /* Check for unsolicited interrupt. */ 809 /* Check for unsolicited interrupt. */
810 if (scsw_stctl(&irb->scsw) == 810 if (scsw_stctl(&irb->scsw) ==
811 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) { 811 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
diff --git a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c
index c4f7bf3e24c2..37f0834300ea 100644
--- a/drivers/s390/cio/eadm_sch.c
+++ b/drivers/s390/cio/eadm_sch.c
@@ -134,7 +134,7 @@ static void eadm_subchannel_irq(struct subchannel *sch)
134{ 134{
135 struct eadm_private *private = get_eadm_private(sch); 135 struct eadm_private *private = get_eadm_private(sch);
136 struct eadm_scsw *scsw = &sch->schib.scsw.eadm; 136 struct eadm_scsw *scsw = &sch->schib.scsw.eadm;
137 struct irb *irb = &__get_cpu_var(cio_irb); 137 struct irb *irb = this_cpu_ptr(&cio_irb);
138 int error = 0; 138 int error = 0;
139 139
140 EADM_LOG(6, "irq"); 140 EADM_LOG(6, "irq");