diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-03-20 23:33:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-21 05:54:10 -0400 |
commit | 09c9e84d474d917d9de5b9011ed2064b03a19677 (patch) | |
tree | c725429e52c2c06822f189d05c8fe9d811e17891 | |
parent | 22de89b371a18086162eacd9f8c960299334ab01 (diff) |
tracing/ring-buffer: don't annotate rb_cpu_notify with __cpuinit
Impact: remove a section warning
CONFIG_DEBUG_SECTION_MISMATCH raises the following warning on -tip:
WARNING: kernel/trace/built-in.o(.text+0x5bc5): Section mismatch in
reference from the function ring_buffer_alloc() to the function
.cpuinit.text:rb_cpu_notify()
The function ring_buffer_alloc() references
the function __cpuinit rb_cpu_notify().
This is actually harmless. The code in the ring buffer don't build
rb_cpu_notify and other cpu hotplug stuffs when !CONFIG_HOTPLUG_CPU
so we have no risk to reference freed memory here (it would even
be harmless if we unconditionally build it because register_cpu_notifier
would do nothing when !CONFIG_HOTPLUG_CPU.
But since ring_buffer_alloc() can be called everytime, we don't want it
to be annotated with __cpuinit so we drop the __cpuinit from
rb_cpu_notify.
This is not a waste of memory because it is only defined and used on
CONFIG_HOTPLUG_CPU.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1237606416-22268-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/trace/ring_buffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 384ca5d9d729..808b14bbf076 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -535,8 +535,8 @@ static void rb_free_cpu_buffer(struct ring_buffer_per_cpu *cpu_buffer) | |||
535 | extern int ring_buffer_page_too_big(void); | 535 | extern int ring_buffer_page_too_big(void); |
536 | 536 | ||
537 | #ifdef CONFIG_HOTPLUG_CPU | 537 | #ifdef CONFIG_HOTPLUG_CPU |
538 | static int __cpuinit rb_cpu_notify(struct notifier_block *self, | 538 | static int rb_cpu_notify(struct notifier_block *self, |
539 | unsigned long action, void *hcpu); | 539 | unsigned long action, void *hcpu); |
540 | #endif | 540 | #endif |
541 | 541 | ||
542 | /** | 542 | /** |
@@ -2784,8 +2784,8 @@ static __init int rb_init_debugfs(void) | |||
2784 | fs_initcall(rb_init_debugfs); | 2784 | fs_initcall(rb_init_debugfs); |
2785 | 2785 | ||
2786 | #ifdef CONFIG_HOTPLUG_CPU | 2786 | #ifdef CONFIG_HOTPLUG_CPU |
2787 | static int __cpuinit rb_cpu_notify(struct notifier_block *self, | 2787 | static int rb_cpu_notify(struct notifier_block *self, |
2788 | unsigned long action, void *hcpu) | 2788 | unsigned long action, void *hcpu) |
2789 | { | 2789 | { |
2790 | struct ring_buffer *buffer = | 2790 | struct ring_buffer *buffer = |
2791 | container_of(self, struct ring_buffer, cpu_notify); | 2791 | container_of(self, struct ring_buffer, cpu_notify); |