aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/microcode.c
diff options
context:
space:
mode:
authorPeter Oruba <peter.oruba@amd.com>2008-08-01 06:46:45 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-15 11:18:45 -0400
commitd33dcb9e7d272cc3171dcc3a21049902185ab03d (patch)
tree9ccd9f6f728c2d7fbd1648ae142690baf9cdad3b /arch/x86/kernel/microcode.c
parent34a1b9fc4995102ecbb3a980b348aebf168d8196 (diff)
x86: Microcode patch loader style corrections
Style corrections to main microcode module. Signed-off-by: Peter Oruba <peter.oruba@amd.com> Cc: Peter Oruba <peter.oruba@amd.com> Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/microcode.c')
-rw-r--r--arch/x86/kernel/microcode.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 28dba1a6e4aa..39961bb83293 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -55,8 +55,8 @@
55 * in a single CPU package. 55 * in a single CPU package.
56 * 1.10 28 Feb 2002 Asit K Mallick <asit.k.mallick@intel.com> and 56 * 1.10 28 Feb 2002 Asit K Mallick <asit.k.mallick@intel.com> and
57 * Tigran Aivazian <tigran@veritas.com>, 57 * Tigran Aivazian <tigran@veritas.com>,
58 * Serialize updates as required on HT processors due to speculative 58 * Serialize updates as required on HT processors due to
59 * nature of implementation. 59 * speculative nature of implementation.
60 * 1.11 22 Mar 2002 Tigran Aivazian <tigran@veritas.com> 60 * 1.11 22 Mar 2002 Tigran Aivazian <tigran@veritas.com>
61 * Fix the panic when writing zero-length microcode chunk. 61 * Fix the panic when writing zero-length microcode chunk.
62 * 1.12 29 Sep 2003 Nitin Kamble <nitin.a.kamble@intel.com>, 62 * 1.12 29 Sep 2003 Nitin Kamble <nitin.a.kamble@intel.com>,
@@ -71,7 +71,7 @@
71 * Thanks to Stuart Swales for pointing out this bug. 71 * Thanks to Stuart Swales for pointing out this bug.
72 */ 72 */
73 73
74//#define DEBUG /* pr_debug */ 74/*#define DEBUG pr_debug */
75#include <linux/capability.h> 75#include <linux/capability.h>
76#include <linux/kernel.h> 76#include <linux/kernel.h>
77#include <linux/init.h> 77#include <linux/init.h>
@@ -116,7 +116,7 @@ EXPORT_SYMBOL_GPL(user_buffer);
116unsigned int user_buffer_size; /* it's size */ 116unsigned int user_buffer_size; /* it's size */
117EXPORT_SYMBOL_GPL(user_buffer_size); 117EXPORT_SYMBOL_GPL(user_buffer_size);
118 118
119static int do_microcode_update (void) 119static int do_microcode_update(void)
120{ 120{
121 long cursor = 0; 121 long cursor = 0;
122 int error = 0; 122 int error = 0;
@@ -158,18 +158,20 @@ out:
158 return error; 158 return error;
159} 159}
160 160
161static int microcode_open (struct inode *unused1, struct file *unused2) 161static int microcode_open(struct inode *unused1, struct file *unused2)
162{ 162{
163 cycle_kernel_lock(); 163 cycle_kernel_lock();
164 return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; 164 return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
165} 165}
166 166
167static ssize_t microcode_write (struct file *file, const char __user *buf, size_t len, loff_t *ppos) 167static ssize_t microcode_write(struct file *file, const char __user *buf,
168 size_t len, loff_t *ppos)
168{ 169{
169 ssize_t ret; 170 ssize_t ret;
170 171
171 if ((len >> PAGE_SHIFT) > num_physpages) { 172 if ((len >> PAGE_SHIFT) > num_physpages) {
172 printk(KERN_ERR "microcode: too much data (max %ld pages)\n", num_physpages); 173 printk(KERN_ERR "microcode: too much data (max %ld pages)\n",
174 num_physpages);
173 return -EINVAL; 175 return -EINVAL;
174 } 176 }
175 177
@@ -201,7 +203,7 @@ static struct miscdevice microcode_dev = {
201 .fops = &microcode_fops, 203 .fops = &microcode_fops,
202}; 204};
203 205
204static int __init microcode_dev_init (void) 206static int __init microcode_dev_init(void)
205{ 207{
206 int error; 208 int error;
207 209
@@ -216,7 +218,7 @@ static int __init microcode_dev_init (void)
216 return 0; 218 return 0;
217} 219}
218 220
219static void microcode_dev_exit (void) 221static void microcode_dev_exit(void)
220{ 222{
221 misc_deregister(&microcode_dev); 223 misc_deregister(&microcode_dev);
222} 224}
@@ -224,7 +226,7 @@ static void microcode_dev_exit (void)
224MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); 226MODULE_ALIAS_MISCDEV(MICROCODE_MINOR);
225#else 227#else
226#define microcode_dev_init() 0 228#define microcode_dev_init() 0
227#define microcode_dev_exit() do { } while(0) 229#define microcode_dev_exit() do { } while (0)
228#endif 230#endif
229 231
230/* fake device for request_firmware */ 232/* fake device for request_firmware */
@@ -451,7 +453,7 @@ int microcode_init(void *opaque, struct module *module)
451} 453}
452EXPORT_SYMBOL_GPL(microcode_init); 454EXPORT_SYMBOL_GPL(microcode_init);
453 455
454void __exit microcode_exit (void) 456void __exit microcode_exit(void)
455{ 457{
456 microcode_dev_exit(); 458 microcode_dev_exit();
457 459