Skip to content

Commit

Permalink
Avoid warning when CPU hotplug isn't enabled
Browse files Browse the repository at this point in the history
Commit e9fb763 ("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>
  • Loading branch information
Linus Torvalds committed May 27, 2010
1 parent e2e2400 commit 00b9b0a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 00b9b0a

Please sign in to comment.