diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-11 06:19:46 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-18 08:51:17 -0400 |
commit | 4bae1967357bfc78a2fad1be5e81a4b868980ae6 (patch) | |
tree | 54ef24a2315ce48d56fadb2e1236f9a04ef59bd0 /arch/x86/kernel/microcode_core.c | |
parent | af5c820a3169e81af869c113e18ec7588836cd50 (diff) |
x86: microcode: cleanup
Impact: cleanup
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: Peter Oruba <peter.oruba@amd.com>
LKML-Reference: <200903111632.37279.rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/microcode_core.c')
-rw-r--r-- | arch/x86/kernel/microcode_core.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 9a8dbc00056..a0f3851ef31 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -70,47 +70,47 @@ | |||
70 | * Fix sigmatch() macro to handle old CPUs with pf == 0. | 70 | * Fix sigmatch() macro to handle old CPUs with pf == 0. |
71 | * Thanks to Stuart Swales for pointing out this bug. | 71 | * Thanks to Stuart Swales for pointing out this bug. |
72 | */ | 72 | */ |
73 | #include <linux/platform_device.h> | ||
73 | #include <linux/capability.h> | 74 | #include <linux/capability.h> |
74 | #include <linux/kernel.h> | 75 | #include <linux/miscdevice.h> |
75 | #include <linux/init.h> | 76 | #include <linux/firmware.h> |
76 | #include <linux/sched.h> | ||
77 | #include <linux/smp_lock.h> | 77 | #include <linux/smp_lock.h> |
78 | #include <linux/spinlock.h> | ||
78 | #include <linux/cpumask.h> | 79 | #include <linux/cpumask.h> |
79 | #include <linux/module.h> | 80 | #include <linux/uaccess.h> |
80 | #include <linux/slab.h> | ||
81 | #include <linux/vmalloc.h> | 81 | #include <linux/vmalloc.h> |
82 | #include <linux/miscdevice.h> | 82 | #include <linux/kernel.h> |
83 | #include <linux/spinlock.h> | 83 | #include <linux/module.h> |
84 | #include <linux/mm.h> | ||
85 | #include <linux/fs.h> | ||
86 | #include <linux/mutex.h> | 84 | #include <linux/mutex.h> |
85 | #include <linux/sched.h> | ||
86 | #include <linux/init.h> | ||
87 | #include <linux/slab.h> | ||
87 | #include <linux/cpu.h> | 88 | #include <linux/cpu.h> |
88 | #include <linux/firmware.h> | 89 | #include <linux/fs.h> |
89 | #include <linux/platform_device.h> | 90 | #include <linux/mm.h> |
90 | 91 | ||
91 | #include <asm/msr.h> | ||
92 | #include <asm/uaccess.h> | ||
93 | #include <asm/processor.h> | ||
94 | #include <asm/microcode.h> | 92 | #include <asm/microcode.h> |
93 | #include <asm/processor.h> | ||
94 | #include <asm/msr.h> | ||
95 | 95 | ||
96 | MODULE_DESCRIPTION("Microcode Update Driver"); | 96 | MODULE_DESCRIPTION("Microcode Update Driver"); |
97 | MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); | 97 | MODULE_AUTHOR("Tigran Aivazian <tigran@aivazian.fsnet.co.uk>"); |
98 | MODULE_LICENSE("GPL"); | 98 | MODULE_LICENSE("GPL"); |
99 | 99 | ||
100 | #define MICROCODE_VERSION "2.00" | 100 | #define MICROCODE_VERSION "2.00" |
101 | 101 | ||
102 | static struct microcode_ops *microcode_ops; | 102 | static struct microcode_ops *microcode_ops; |
103 | 103 | ||
104 | /* no concurrent ->write()s are allowed on /dev/cpu/microcode */ | 104 | /* no concurrent ->write()s are allowed on /dev/cpu/microcode */ |
105 | static DEFINE_MUTEX(microcode_mutex); | 105 | static DEFINE_MUTEX(microcode_mutex); |
106 | 106 | ||
107 | struct ucode_cpu_info ucode_cpu_info[NR_CPUS]; | 107 | struct ucode_cpu_info ucode_cpu_info[NR_CPUS]; |
108 | EXPORT_SYMBOL_GPL(ucode_cpu_info); | 108 | EXPORT_SYMBOL_GPL(ucode_cpu_info); |
109 | 109 | ||
110 | #ifdef CONFIG_MICROCODE_OLD_INTERFACE | 110 | #ifdef CONFIG_MICROCODE_OLD_INTERFACE |
111 | struct update_for_cpu { | 111 | struct update_for_cpu { |
112 | const void __user *buf; | 112 | const void __user *buf; |
113 | size_t size; | 113 | size_t size; |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static long update_for_cpu(void *_ufc) | 116 | static long update_for_cpu(void *_ufc) |
@@ -209,12 +209,12 @@ static void microcode_dev_exit(void) | |||
209 | 209 | ||
210 | MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); | 210 | MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); |
211 | #else | 211 | #else |
212 | #define microcode_dev_init() 0 | 212 | #define microcode_dev_init() 0 |
213 | #define microcode_dev_exit() do { } while (0) | 213 | #define microcode_dev_exit() do { } while (0) |
214 | #endif | 214 | #endif |
215 | 215 | ||
216 | /* fake device for request_firmware */ | 216 | /* fake device for request_firmware */ |
217 | static struct platform_device *microcode_pdev; | 217 | static struct platform_device *microcode_pdev; |
218 | 218 | ||
219 | static long reload_for_cpu(void *unused) | 219 | static long reload_for_cpu(void *unused) |
220 | { | 220 | { |
@@ -282,8 +282,8 @@ static struct attribute *mc_default_attrs[] = { | |||
282 | }; | 282 | }; |
283 | 283 | ||
284 | static struct attribute_group mc_attr_group = { | 284 | static struct attribute_group mc_attr_group = { |
285 | .attrs = mc_default_attrs, | 285 | .attrs = mc_default_attrs, |
286 | .name = "microcode", | 286 | .name = "microcode", |
287 | }; | 287 | }; |
288 | 288 | ||
289 | static void __microcode_fini_cpu(int cpu) | 289 | static void __microcode_fini_cpu(int cpu) |
@@ -353,7 +353,7 @@ static long microcode_update_cpu(void *unused) | |||
353 | */ | 353 | */ |
354 | if (uci->valid) { | 354 | if (uci->valid) { |
355 | err = microcode_resume_cpu(smp_processor_id()); | 355 | err = microcode_resume_cpu(smp_processor_id()); |
356 | } else { | 356 | } else { |
357 | collect_cpu_info(smp_processor_id()); | 357 | collect_cpu_info(smp_processor_id()); |
358 | if (uci->valid && system_state == SYSTEM_RUNNING) | 358 | if (uci->valid && system_state == SYSTEM_RUNNING) |
359 | err = microcode_ops->request_microcode_fw( | 359 | err = microcode_ops->request_microcode_fw( |
@@ -423,9 +423,9 @@ static int mc_sysdev_resume(struct sys_device *dev) | |||
423 | } | 423 | } |
424 | 424 | ||
425 | static struct sysdev_driver mc_sysdev_driver = { | 425 | static struct sysdev_driver mc_sysdev_driver = { |
426 | .add = mc_sysdev_add, | 426 | .add = mc_sysdev_add, |
427 | .remove = mc_sysdev_remove, | 427 | .remove = mc_sysdev_remove, |
428 | .resume = mc_sysdev_resume, | 428 | .resume = mc_sysdev_resume, |
429 | }; | 429 | }; |
430 | 430 | ||
431 | static __cpuinit int | 431 | static __cpuinit int |
@@ -464,7 +464,7 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) | |||
464 | } | 464 | } |
465 | 465 | ||
466 | static struct notifier_block __refdata mc_cpu_notifier = { | 466 | static struct notifier_block __refdata mc_cpu_notifier = { |
467 | .notifier_call = mc_cpu_callback, | 467 | .notifier_call = mc_cpu_callback, |
468 | }; | 468 | }; |
469 | 469 | ||
470 | static int __init microcode_init(void) | 470 | static int __init microcode_init(void) |