diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2009-05-27 22:41:01 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-28 12:24:16 -0400 |
commit | 98a9c8c3ba13dfc3df8e6d2a126d2fa4e4621e9c (patch) | |
tree | 3a3fa59159ba65160df4ae600725eddcc8782a17 /arch/x86/kernel/cpu/mcheck/mce-inject.c | |
parent | 61a021a0700c22ee527d73d92f9acb109ff478f8 (diff) |
x86, mce: trivial clean up for mce-inject.c
Fix for:
WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
+#include <asm/uaccess.h>
WARNING: usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc
+ if (m.cpu >= NR_CPUS || !cpu_online(m.cpu))
ERROR: trailing whitespace
+/* $
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck/mce-inject.c')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-inject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c index 673c72855022..7b3a5428396a 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-inject.c +++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c | |||
@@ -11,13 +11,13 @@ | |||
11 | * Andi Kleen | 11 | * Andi Kleen |
12 | * Ying Huang | 12 | * Ying Huang |
13 | */ | 13 | */ |
14 | #include <linux/uaccess.h> | ||
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
17 | #include <linux/string.h> | 18 | #include <linux/string.h> |
18 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
19 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
20 | #include <asm/uaccess.h> | ||
21 | #include <asm/mce.h> | 21 | #include <asm/mce.h> |
22 | 22 | ||
23 | /* Update fake mce registers on current CPU. */ | 23 | /* Update fake mce registers on current CPU. */ |
@@ -93,7 +93,7 @@ static ssize_t mce_write(struct file *filp, const char __user *ubuf, | |||
93 | if (copy_from_user(&m, ubuf, usize)) | 93 | if (copy_from_user(&m, ubuf, usize)) |
94 | return -EFAULT; | 94 | return -EFAULT; |
95 | 95 | ||
96 | if (m.cpu >= NR_CPUS || !cpu_online(m.cpu)) | 96 | if (m.cpu >= num_possible_cpus() || !cpu_online(m.cpu)) |
97 | return -EINVAL; | 97 | return -EINVAL; |
98 | 98 | ||
99 | dm = kmalloc(sizeof(struct delayed_mce), GFP_KERNEL); | 99 | dm = kmalloc(sizeof(struct delayed_mce), GFP_KERNEL); |