diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd_64.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 0c563432e25c..ddae21620bda 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/notifier.h> | 17 | #include <linux/notifier.h> |
18 | #include <linux/kobject.h> | 18 | #include <linux/kobject.h> |
19 | #include <linux/percpu.h> | ||
19 | #include <linux/sysdev.h> | 20 | #include <linux/sysdev.h> |
20 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
21 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
@@ -24,7 +25,6 @@ | |||
24 | #include <linux/cpu.h> | 25 | #include <linux/cpu.h> |
25 | #include <linux/smp.h> | 26 | #include <linux/smp.h> |
26 | 27 | ||
27 | #include <asm/percpu.h> | ||
28 | #include <asm/apic.h> | 28 | #include <asm/apic.h> |
29 | #include <asm/idle.h> | 29 | #include <asm/idle.h> |
30 | #include <asm/mce.h> | 30 | #include <asm/mce.h> |
@@ -344,17 +344,13 @@ static ssize_t store_error_count(struct threshold_block *b, | |||
344 | return 1; | 344 | return 1; |
345 | } | 345 | } |
346 | 346 | ||
347 | #define THRESHOLD_ATTR(_name, _mode, _show, _store) \ | 347 | #define RW_ATTR(val) \ |
348 | { \ | 348 | static struct threshold_attr val = { \ |
349 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | 349 | .attr = {.name = __stringify(val), .mode = 0644 }, \ |
350 | .show = _show, \ | 350 | .show = show_## val, \ |
351 | .store = _store, \ | 351 | .store = store_## val, \ |
352 | }; | 352 | }; |
353 | 353 | ||
354 | #define RW_ATTR(name) \ | ||
355 | static struct threshold_attr name = \ | ||
356 | THRESHOLD_ATTR(name, 0644, show_## name, store_## name) | ||
357 | |||
358 | RW_ATTR(interrupt_enable); | 354 | RW_ATTR(interrupt_enable); |
359 | RW_ATTR(threshold_limit); | 355 | RW_ATTR(threshold_limit); |
360 | RW_ATTR(error_count); | 356 | RW_ATTR(error_count); |
@@ -675,9 +671,6 @@ static void threshold_remove_device(unsigned int cpu) | |||
675 | static void __cpuinit | 671 | static void __cpuinit |
676 | amd_64_threshold_cpu_callback(unsigned long action, unsigned int cpu) | 672 | amd_64_threshold_cpu_callback(unsigned long action, unsigned int cpu) |
677 | { | 673 | { |
678 | if (cpu >= NR_CPUS) | ||
679 | return; | ||
680 | |||
681 | switch (action) { | 674 | switch (action) { |
682 | case CPU_ONLINE: | 675 | case CPU_ONLINE: |
683 | case CPU_ONLINE_FROZEN: | 676 | case CPU_ONLINE_FROZEN: |