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>
This commit is contained in:
Hidetoshi Seto 2009-05-28 11:41:01 +09:00 committed by H. Peter Anvin
parent 61a021a070
commit 98a9c8c3ba
1 changed files with 2 additions and 2 deletions

View File

@ -11,13 +11,13 @@
* Andi Kleen * Andi Kleen
* Ying Huang * Ying Huang
*/ */
#include <linux/uaccess.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <asm/uaccess.h>
#include <asm/mce.h> #include <asm/mce.h>
/* Update fake mce registers on current CPU. */ /* Update fake mce registers on current CPU. */
@ -93,7 +93,7 @@ static ssize_t mce_write(struct file *filp, const char __user *ubuf,
if (copy_from_user(&m, ubuf, usize)) if (copy_from_user(&m, ubuf, usize))
return -EFAULT; return -EFAULT;
if (m.cpu >= NR_CPUS || !cpu_online(m.cpu)) if (m.cpu >= num_possible_cpus() || !cpu_online(m.cpu))
return -EINVAL; return -EINVAL;
dm = kmalloc(sizeof(struct delayed_mce), GFP_KERNEL); dm = kmalloc(sizeof(struct delayed_mce), GFP_KERNEL);