aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/processor_idle.c6
-rw-r--r--drivers/char/random.c2
-rw-r--r--drivers/connector/cn_proc.c5
-rw-r--r--drivers/cpuidle/cpuidle.c2
-rw-r--r--drivers/input/gameport/gameport.c2
-rw-r--r--drivers/s390/cio/cio.c2
-rw-r--r--drivers/staging/lirc/lirc_serial.c4
-rw-r--r--drivers/staging/speakup/fakekey.c11
-rw-r--r--drivers/xen/events.c10
9 files changed, 20 insertions, 24 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index dcb38f8ddfda..a765b823aa9e 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -746,7 +746,7 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
746 struct acpi_processor *pr; 746 struct acpi_processor *pr;
747 struct acpi_processor_cx *cx = cpuidle_get_statedata(state); 747 struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
748 748
749 pr = __get_cpu_var(processors); 749 pr = __this_cpu_read(processors);
750 750
751 if (unlikely(!pr)) 751 if (unlikely(!pr))
752 return 0; 752 return 0;
@@ -787,7 +787,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
787 s64 idle_time_ns; 787 s64 idle_time_ns;
788 s64 idle_time; 788 s64 idle_time;
789 789
790 pr = __get_cpu_var(processors); 790 pr = __this_cpu_read(processors);
791 791
792 if (unlikely(!pr)) 792 if (unlikely(!pr))
793 return 0; 793 return 0;
@@ -864,7 +864,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
864 s64 idle_time; 864 s64 idle_time;
865 865
866 866
867 pr = __get_cpu_var(processors); 867 pr = __this_cpu_read(processors);
868 868
869 if (unlikely(!pr)) 869 if (unlikely(!pr))
870 return 0; 870 return 0;
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 5a1aa64f4e76..72a4fcb17745 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -626,7 +626,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
626 preempt_disable(); 626 preempt_disable();
627 /* if over the trickle threshold, use only 1 in 4096 samples */ 627 /* if over the trickle threshold, use only 1 in 4096 samples */
628 if (input_pool.entropy_count > trickle_thresh && 628 if (input_pool.entropy_count > trickle_thresh &&
629 (__get_cpu_var(trickle_count)++ & 0xfff)) 629 ((__this_cpu_inc_return(trickle_count) - 1) & 0xfff))
630 goto out; 630 goto out;
631 631
632 sample.jiffies = jiffies; 632 sample.jiffies = jiffies;
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index a7f046b0096c..2b46a7efa0ac 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -43,9 +43,10 @@ static DEFINE_PER_CPU(__u32, proc_event_counts) = { 0 };
43 43
44static inline void get_seq(__u32 *ts, int *cpu) 44static inline void get_seq(__u32 *ts, int *cpu)
45{ 45{
46 *ts = get_cpu_var(proc_event_counts)++; 46 preempt_disable();
47 *ts = __this_cpu_inc_return(proc_event_counts) -1;
47 *cpu = smp_processor_id(); 48 *cpu = smp_processor_id();
48 put_cpu_var(proc_event_counts); 49 preempt_enable();
49} 50}
50 51
51void proc_fork_connector(struct task_struct *task) 52void proc_fork_connector(struct task_struct *task)
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 08d5f05378d9..386888f10df0 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -49,7 +49,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev);
49 */ 49 */
50static void cpuidle_idle_call(void) 50static void cpuidle_idle_call(void)
51{ 51{
52 struct cpuidle_device *dev = __get_cpu_var(cpuidle_devices); 52 struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
53 struct cpuidle_state *target_state; 53 struct cpuidle_state *target_state;
54 int next_state; 54 int next_state;
55 55
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index dbf741c95835..23cf8fc933ec 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -121,7 +121,7 @@ static int gameport_measure_speed(struct gameport *gameport)
121 } 121 }
122 122
123 gameport_close(gameport); 123 gameport_close(gameport);
124 return (cpu_data(raw_smp_processor_id()).loops_per_jiffy * 124 return (this_cpu_read(cpu_info.loops_per_jiffy) *
125 (unsigned long)HZ / (1000 / 50)) / (tx < 1 ? 1 : tx); 125 (unsigned long)HZ / (1000 / 50)) / (tx < 1 ? 1 : tx);
126 126
127#else 127#else
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index f4e6cf3aceb8..430f875006f2 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -619,7 +619,7 @@ void __irq_entry do_IRQ(struct pt_regs *regs)
619 s390_idle_check(regs, S390_lowcore.int_clock, 619 s390_idle_check(regs, S390_lowcore.int_clock,
620 S390_lowcore.async_enter_timer); 620 S390_lowcore.async_enter_timer);
621 irq_enter(); 621 irq_enter();
622 __get_cpu_var(s390_idle).nohz_delay = 1; 622 __this_cpu_write(s390_idle.nohz_delay, 1);
623 if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator) 623 if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator)
624 /* Serve timer interrupts first. */ 624 /* Serve timer interrupts first. */
625 clock_comparator_work(); 625 clock_comparator_work();
diff --git a/drivers/staging/lirc/lirc_serial.c b/drivers/staging/lirc/lirc_serial.c
index 971844bbee28..9bcf149c4260 100644
--- a/drivers/staging/lirc/lirc_serial.c
+++ b/drivers/staging/lirc/lirc_serial.c
@@ -377,7 +377,7 @@ static int init_timing_params(unsigned int new_duty_cycle,
377 duty_cycle = new_duty_cycle; 377 duty_cycle = new_duty_cycle;
378 freq = new_freq; 378 freq = new_freq;
379 379
380 loops_per_sec = current_cpu_data.loops_per_jiffy; 380 loops_per_sec = __this_cpu_read(cpu.info.loops_per_jiffy);
381 loops_per_sec *= HZ; 381 loops_per_sec *= HZ;
382 382
383 /* How many clocks in a microsecond?, avoiding long long divide */ 383 /* How many clocks in a microsecond?, avoiding long long divide */
@@ -398,7 +398,7 @@ static int init_timing_params(unsigned int new_duty_cycle,
398 dprintk("in init_timing_params, freq=%d, duty_cycle=%d, " 398 dprintk("in init_timing_params, freq=%d, duty_cycle=%d, "
399 "clk/jiffy=%ld, pulse=%ld, space=%ld, " 399 "clk/jiffy=%ld, pulse=%ld, space=%ld, "
400 "conv_us_to_clocks=%ld\n", 400 "conv_us_to_clocks=%ld\n",
401 freq, duty_cycle, current_cpu_data.loops_per_jiffy, 401 freq, duty_cycle, __this_cpu_read(cpu_info.loops_per_jiffy),
402 pulse_width, space_width, conv_us_to_clocks); 402 pulse_width, space_width, conv_us_to_clocks);
403 return 0; 403 return 0;
404} 404}
diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c
index 65b231178f05..1b34a8771641 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -78,10 +78,10 @@ void speakup_fake_down_arrow(void)
78 /* don't change CPU */ 78 /* don't change CPU */
79 preempt_disable(); 79 preempt_disable();
80 80
81 __get_cpu_var(reporting_keystroke) = true; 81 __this_cpu_write(reporting_keystroke, true);
82 input_report_key(virt_keyboard, KEY_DOWN, PRESSED); 82 input_report_key(virt_keyboard, KEY_DOWN, PRESSED);
83 input_report_key(virt_keyboard, KEY_DOWN, RELEASED); 83 input_report_key(virt_keyboard, KEY_DOWN, RELEASED);
84 __get_cpu_var(reporting_keystroke) = false; 84 __this_cpu_write(reporting_keystroke, false);
85 85
86 /* reenable preemption */ 86 /* reenable preemption */
87 preempt_enable(); 87 preempt_enable();
@@ -95,10 +95,5 @@ void speakup_fake_down_arrow(void)
95 */ 95 */
96bool speakup_fake_key_pressed(void) 96bool speakup_fake_key_pressed(void)
97{ 97{
98 bool is_pressed; 98 return this_cpu_read(reporting_keystroke);
99
100 is_pressed = get_cpu_var(reporting_keystroke);
101 put_cpu_var(reporting_keystroke);
102
103 return is_pressed;
104} 99}
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 31af0ac31a98..65f8637d13cf 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -355,7 +355,7 @@ static void unmask_evtchn(int port)
355 struct evtchn_unmask unmask = { .port = port }; 355 struct evtchn_unmask unmask = { .port = port };
356 (void)HYPERVISOR_event_channel_op(EVTCHNOP_unmask, &unmask); 356 (void)HYPERVISOR_event_channel_op(EVTCHNOP_unmask, &unmask);
357 } else { 357 } else {
358 struct vcpu_info *vcpu_info = __get_cpu_var(xen_vcpu); 358 struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
359 359
360 sync_clear_bit(port, &s->evtchn_mask[0]); 360 sync_clear_bit(port, &s->evtchn_mask[0]);
361 361
@@ -1101,7 +1101,7 @@ static void __xen_evtchn_do_upcall(void)
1101{ 1101{
1102 int cpu = get_cpu(); 1102 int cpu = get_cpu();
1103 struct shared_info *s = HYPERVISOR_shared_info; 1103 struct shared_info *s = HYPERVISOR_shared_info;
1104 struct vcpu_info *vcpu_info = __get_cpu_var(xen_vcpu); 1104 struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
1105 unsigned count; 1105 unsigned count;
1106 1106
1107 do { 1107 do {
@@ -1109,7 +1109,7 @@ static void __xen_evtchn_do_upcall(void)
1109 1109
1110 vcpu_info->evtchn_upcall_pending = 0; 1110 vcpu_info->evtchn_upcall_pending = 0;
1111 1111
1112 if (__get_cpu_var(xed_nesting_count)++) 1112 if (__this_cpu_inc_return(xed_nesting_count) - 1)
1113 goto out; 1113 goto out;
1114 1114
1115#ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */ 1115#ifndef CONFIG_X86 /* No need for a barrier -- XCHG is a barrier on x86. */
@@ -1141,8 +1141,8 @@ static void __xen_evtchn_do_upcall(void)
1141 1141
1142 BUG_ON(!irqs_disabled()); 1142 BUG_ON(!irqs_disabled());
1143 1143
1144 count = __get_cpu_var(xed_nesting_count); 1144 count = __this_cpu_read(xed_nesting_count);
1145 __get_cpu_var(xed_nesting_count) = 0; 1145 __this_cpu_write(xed_nesting_count, 0);
1146 } while (count != 1 || vcpu_info->evtchn_upcall_pending); 1146 } while (count != 1 || vcpu_info->evtchn_upcall_pending);
1147 1147
1148out: 1148out: