Re: [PATCH] powerpc: fix register_power_pmu() section mismatch warning

2010-05-12 Thread Paul Mackerras
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.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] powerpc: fix register_power_pmu() section mismatch warning

2010-05-12 Thread 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 
---
 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

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev