Skip to contentSkip to conversation

perf, x86: Fix section mismatch in split uncore driver

PATCH New Andi Kleen 2 participants 2 messages Aug 29, 2014 – Sep 9, 2014

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 perf, x86: Fix section mismatch in split uncore driver

From: Andi Kleen <[email protected]>

The new split Intel uncore driver code that recently went into tip added a section mismatch, which the build process complains about.

uncore_pmu_register can be called from uncore_pci_probe, which is not __init and can be called from pci driver ->probe. I'm not fully sure if it's actually possible to call the probe function later, but it seems safer to mark uncore_pmu_register not __init.

This also fixes the warning.

---
 arch/x86/kernel/cpu/perf_event_intel_uncore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event_intel_uncore.c +1 -1
index b0c48bf..42d00e5 100644
@@ -661,7 +661,7 @@ static struct attribute_group uncore_pmu_attr_group = {
 	.attrs = uncore_pmu_attrs,
 };
 
-static int __init uncore_pmu_register(struct intel_uncore_pmu *pmu)
+static int uncore_pmu_register(struct intel_uncore_pmu *pmu)
 {
 	int ret;
 
Signature · 1 line
1.9.3
#1 lore raw

[tip:perf/core] perf/x86: Fix section mismatch in split uncore driver

perf/x86: Fix section mismatch in split uncore driver
Commit-ID:  a08b6769d4c5e8d2a3192a45e40b3cdcca0da6a1
Gitweb:     http://git.kernel.org/tip/a08b6769d4c5e8d2a3192a45e40b3cdcca0da6a1
Author:     Andi Kleen <[email protected]>
AuthorDate: Fri, 29 Aug 2014 10:20:58 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 9 Sep 2014 06:53:08 +0200

perf/x86: Fix section mismatch in split uncore driver

The new split Intel uncore driver code that recently went into tip added a section mismatch, which the build process complains about.

uncore_pmu_register() can be called from uncore_pci_probe,() which is not __init and can be called from pci driver ->probe. I'm not fully sure if it's actually possible to call the probe function later, but it seems safer to mark uncore_pmu_register not __init.

This also fixes the warning.

---
 arch/x86/kernel/cpu/perf_event_intel_uncore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event_intel_uncore.c +1 -1
index 4785ee8..812ec5d 100644
@@ -661,7 +661,7 @@ static struct attribute_group uncore_pmu_attr_group = {
 	.attrs = uncore_pmu_attrs,
 };
 
-static int __init uncore_pmu_register(struct intel_uncore_pmu *pmu)
+static int uncore_pmu_register(struct intel_uncore_pmu *pmu)
 {
 	int ret;