diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 13:32:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 13:32:08 -0400 |
commit | 00b9b0af5887fed54e899e3b7f5c2ccf5e739def (patch) | |
tree | 088cd96759cf4c1b2365c0e434dc95a8410b547c /kernel/cpu.c | |
parent | e2e2400bd4faee24d11872134b7ae5bd363749c0 (diff) |
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 <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 9 |
1 files changed, 3 insertions, 6 deletions
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) | |||
154 | return __cpu_notify(val, v, -1, NULL); | 154 | return __cpu_notify(val, v, -1, NULL); |
155 | } | 155 | } |
156 | 156 | ||
157 | #ifdef CONFIG_HOTPLUG_CPU | ||
158 | |||
157 | static void cpu_notify_nofail(unsigned long val, void *v) | 159 | static void cpu_notify_nofail(unsigned long val, void *v) |
158 | { | 160 | { |
159 | int err; | 161 | BUG_ON(cpu_notify(val, v)); |
160 | |||
161 | err = cpu_notify(val, v); | ||
162 | BUG_ON(err); | ||
163 | } | 162 | } |
164 | 163 | ||
165 | #ifdef CONFIG_HOTPLUG_CPU | ||
166 | |||
167 | EXPORT_SYMBOL(register_cpu_notifier); | 164 | EXPORT_SYMBOL(register_cpu_notifier); |
168 | 165 | ||
169 | void __ref unregister_cpu_notifier(struct notifier_block *nb) | 166 | void __ref unregister_cpu_notifier(struct notifier_block *nb) |