[PATCH] i386: Fix warning in mpparse.c
[safe/jmp/linux-2.6] / arch / i386 / kernel / cpuid.c
index 13bae79..fde8bea 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -117,14 +116,13 @@ static ssize_t cpuid_read(struct file *file, char __user *buf,
 {
        char __user *tmp = buf;
        u32 data[4];
-       size_t rv;
        u32 reg = *ppos;
        int cpu = iminor(file->f_dentry->d_inode);
 
        if (count % 16)
                return -EINVAL; /* Invalid chunk size */
 
-       for (rv = 0; count; count -= 16) {
+       for (; count; count -= 16) {
                do_cpuid(cpu, reg, data);
                if (copy_to_user(tmp, &data, 16))
                        return -EFAULT;
@@ -169,7 +167,8 @@ static int cpuid_class_device_create(int i)
        return err;
 }
 
-static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+#ifdef CONFIG_HOTPLUG_CPU
+static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
 
@@ -184,10 +183,11 @@ static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsign
        return NOTIFY_OK;
 }
 
-static struct notifier_block cpuid_class_cpu_notifier =
+static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
 {
        .notifier_call = cpuid_class_cpu_callback,
 };
+#endif /* !CONFIG_HOTPLUG_CPU */
 
 static int __init cpuid_init(void)
 {
@@ -210,7 +210,7 @@ static int __init cpuid_init(void)
                if (err != 0) 
                        goto out_class;
        }
-       register_cpu_notifier(&cpuid_class_cpu_notifier);
+       register_hotcpu_notifier(&cpuid_class_cpu_notifier);
 
        err = 0;
        goto out;
@@ -235,7 +235,7 @@ static void __exit cpuid_exit(void)
                class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
        class_destroy(cpuid_class);
        unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
-       unregister_cpu_notifier(&cpuid_class_cpu_notifier);
+       unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
 }
 
 module_init(cpuid_init);