Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-drm-fsl-dcu.git] / arch / x86_64 / kernel / mce_amd.c
index 335200aa27379a269d8cd3ac1661b351d8cff92e..93c707257637cdea3b40eb472e7ab7baa442245f 100644 (file)
@@ -401,7 +401,6 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
        b = kzalloc(sizeof(struct threshold_block), GFP_KERNEL);
        if (!b)
                return -ENOMEM;
-       memset(b, 0, sizeof(struct threshold_block));
 
        b->block = block;
        b->bank = bank;
@@ -490,7 +489,6 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
                err = -ENOMEM;
                goto out;
        }
-       memset(b, 0, sizeof(struct threshold_bank));
 
        kobject_set_name(&b->kobj, "threshold_bank%i", bank);
        b->kobj.parent = &per_cpu(device_mce, cpu).kobj;
@@ -551,14 +549,13 @@ out:
        return err;
 }
 
-#ifdef CONFIG_HOTPLUG_CPU
 /*
  * let's be hotplug friendly.
  * in case of multiple core processors, the first core always takes ownership
  *   of shared sysfs dir/files, and rest of the cores will be symlinked to it.
  */
 
-static __cpuinit void deallocate_threshold_block(unsigned int cpu,
+static void deallocate_threshold_block(unsigned int cpu,
                                                 unsigned int bank)
 {
        struct threshold_block *pos = NULL;
@@ -578,7 +575,7 @@ static __cpuinit void deallocate_threshold_block(unsigned int cpu,
        per_cpu(threshold_banks, cpu)[bank]->blocks = NULL;
 }
 
-static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank)
+static void threshold_remove_bank(unsigned int cpu, int bank)
 {
        int i = 0;
        struct threshold_bank *b;
@@ -594,12 +591,14 @@ static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank)
 
        sprintf(name, "threshold_bank%i", bank);
 
+#ifdef CONFIG_SMP
        /* sibling symlink */
        if (shared_bank[bank] && b->blocks->cpu != cpu) {
                sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name);
-               per_cpu(threshold_banks, i)[bank] = NULL;
+               per_cpu(threshold_banks, cpu)[bank] = NULL;
                return;
        }
+#endif
 
        /* remove all sibling symlinks before unregistering */
        for_each_cpu_mask(i, b->cpus) {
@@ -618,7 +617,7 @@ free_out:
        per_cpu(threshold_banks, cpu)[bank] = NULL;
 }
 
-static __cpuinit void threshold_remove_device(unsigned int cpu)
+static void threshold_remove_device(unsigned int cpu)
 {
        unsigned int bank;
 
@@ -629,14 +628,8 @@ static __cpuinit void threshold_remove_device(unsigned int cpu)
        }
 }
 
-#else /* !CONFIG_HOTPLUG_CPU */
-static void threshold_remove_device(unsigned int cpu)
-{
-}
-#endif
-
 /* get notified when a cpu comes on/off */
-static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
+static int threshold_cpu_callback(struct notifier_block *nfb,
                                            unsigned long action, void *hcpu)
 {
        /* cpu was unsigned int to begin with */
@@ -659,7 +652,7 @@ static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb,
        return NOTIFY_OK;
 }
 
-static struct notifier_block threshold_cpu_notifier __cpuinitdata = {
+static struct notifier_block threshold_cpu_notifier = {
        .notifier_call = threshold_cpu_callback,
 };
 
@@ -673,7 +666,7 @@ static __init int threshold_init_device(void)
                if (err)
                        return err;
        }
-       register_cpu_notifier(&threshold_cpu_notifier);
+       register_hotcpu_notifier(&threshold_cpu_notifier);
        return 0;
 }