From: Linus Torvalds Date: Thu, 27 May 2010 17:32:08 +0000 (-0700) Subject: Avoid warning when CPU hotplug isn't enabled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=00b9b0af5887fed54e899e3b7f5c2ccf5e739def;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git Avoid warning when CPU hotplug isn't enabled Commit e9fb7631ebcd ("cpu-hotplug: introduce cpu_notify(), __cpu_notify(), cpu_notify_nofail()") also introduced this annoying warning: kernel/cpu.c:157: warning: 'cpu_notify_nofail' defined but not used when CONFIG_HOTPLUG_CPU wasn't set. So move that helper inside the #ifdef CONFIG_HOTPLUG_CPU region, and simplify it while at it. Signed-off-by: Linus Torvalds --- diff --git a/kernel/cpu.c b/kernel/cpu.c index 63e8de13c948..3097382eb44a 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -154,16 +154,13 @@ static int cpu_notify(unsigned long val, void *v) return __cpu_notify(val, v, -1, NULL); } +#ifdef CONFIG_HOTPLUG_CPU + static void cpu_notify_nofail(unsigned long val, void *v) { - int err; - - err = cpu_notify(val, v); - BUG_ON(err); + BUG_ON(cpu_notify(val, v)); } -#ifdef CONFIG_HOTPLUG_CPU - EXPORT_SYMBOL(register_cpu_notifier); void __ref unregister_cpu_notifier(struct notifier_block *nb)