* [PATCH] powerpc: fix register_power_pmu() section mismatch warning
@ 2010-05-12 18:04 Albert Herranz
2010-05-13 0:09 ` Paul Mackerras
0 siblings, 1 reply; 2+ messages in thread
From: Albert Herranz @ 2010-05-12 18:04 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Albert Herranz
Add missing __cpuinit annotations to fix a bunch of warnings like the one
shown below when building a kernel for the PowerPC architecture with
CONFIG_DEBUG_SECTION_MISMATCH=y.
WARNING: arch/powerpc/kernel/built-in.o(.text+0x11c72): Section mismatch in reference from the function register_power_pmu() to the variable .cpuinit.data:power_pmu_notifier_nb.23552
The function register_power_pmu() references
the variable __cpuinitdata power_pmu_notifier_nb.23552.
This is often because register_power_pmu lacks a __cpuinitdata
annotation or the annotation of power_pmu_notifier_nb.23552 is wrong.
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
---
arch/powerpc/kernel/mpc7450-pmu.c | 2 +-
arch/powerpc/kernel/perf_event.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/mpc7450-pmu.c b/arch/powerpc/kernel/mpc7450-pmu.c
index 09d7202..3982bfa 100644
--- a/arch/powerpc/kernel/mpc7450-pmu.c
+++ b/arch/powerpc/kernel/mpc7450-pmu.c
@@ -405,7 +405,7 @@ struct power_pmu mpc7450_pmu = {
.cache_events = &mpc7450_cache_events,
};
-static int init_mpc7450_pmu(void)
+static int __cpuinit init_mpc7450_pmu(void)
{
if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/7450"))
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
index 08460a2..6b70834 100644
--- a/arch/powerpc/kernel/perf_event.c
+++ b/arch/powerpc/kernel/perf_event.c
@@ -1314,7 +1314,7 @@ power_pmu_notifier(struct notifier_block *self, unsigned long action, void *hcpu
return NOTIFY_OK;
}
-int register_power_pmu(struct power_pmu *pmu)
+int __cpuinit register_power_pmu(struct power_pmu *pmu)
{
if (ppmu)
return -EBUSY; /* something's already registered */
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] powerpc: fix register_power_pmu() section mismatch warning
2010-05-12 18:04 [PATCH] powerpc: fix register_power_pmu() section mismatch warning Albert Herranz
@ 2010-05-13 0:09 ` Paul Mackerras
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mackerras @ 2010-05-13 0:09 UTC (permalink / raw)
To: Albert Herranz; +Cc: linuxppc-dev
On Wed, May 12, 2010 at 08:04:46PM +0200, Albert Herranz wrote:
> Add missing __cpuinit annotations to fix a bunch of warnings like the one
> shown below when building a kernel for the PowerPC architecture with
> CONFIG_DEBUG_SECTION_MISMATCH=y.
>
> WARNING: arch/powerpc/kernel/built-in.o(.text+0x11c72): Section mismatch in reference from the function register_power_pmu() to the variable .cpuinit.data:power_pmu_notifier_nb.23552
> The function register_power_pmu() references
> the variable __cpuinitdata power_pmu_notifier_nb.23552.
> This is often because register_power_pmu lacks a __cpuinitdata
> annotation or the annotation of power_pmu_notifier_nb.23552 is wrong.
Hmmm, I would think these things could be just plain __init, not
__cpuinit. They're not called on cpu hotplug events.
Paul.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-13 0:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 18:04 [PATCH] powerpc: fix register_power_pmu() section mismatch warning Albert Herranz
2010-05-13 0:09 ` Paul Mackerras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).