Skip to contentSkip to conversation

x86-64: adjust section annotations in AMD Fam10 MMCONF enabling code

PATCH In review Jan Beulich 2 participants 2 messages Nov 4, 2010 – Nov 5, 2010 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86-64: adjust section annotations in AMD Fam10 MMCONF enabling code

check_enable_amd_mmconf_dmi() gets called only for the BSP, hence everything hanging off of it can be __init*.

---
 arch/x86/kernel/mmconf-fam10h_64.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/x86/kernel/mmconf-fam10h_64.c +4 -3
@@ -217,13 +217,13 @@ void __cpuinit fam10h_check_enable_mmcfg
 	wrmsrl(address, val);
 }
 
-static int __devinit set_check_enable_amd_mmconf(const struct dmi_system_id *d)
+static int __init set_check_enable_amd_mmconf(const struct dmi_system_id *d)
 {
         pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
         return 0;
 }
 
-static const struct dmi_system_id __cpuinitconst mmconf_dmi_table[] = {
+static const struct dmi_system_id __initconst mmconf_dmi_table[] = {
         {
                 .callback = set_check_enable_amd_mmconf,
                 .ident = "Sun Microsystems Machine",
@@ -234,7 +234,8 @@ static const struct dmi_system_id __cpui
 	{}
 };
 
-void __cpuinit check_enable_amd_mmconf_dmi(void)
+/* Called from a __cpuinit function, but only on the BSP. */
+void __ref check_enable_amd_mmconf_dmi(void)
 {
 	dmi_check_system(mmconf_dmi_table);
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Jan Beulich

check_enable_amd_mmconf_dmi() gets called only for the BSP, hence everything hanging off of it can be __init*.

---
 arch/x86/kernel/mmconf-fam10h_64.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/x86/kernel/mmconf-fam10h_64.c +2 -2
@@ -217,13 +217,13 @@ void __cpuinit fam10h_check_enable_mmcfg
 	wrmsrl(address, val);
 }
 
-static int __devinit set_check_enable_amd_mmconf(const struct dmi_system_id *d)
+static int __init set_check_enable_amd_mmconf(const struct dmi_system_id *d)
 {
         pci_probe |= PCI_CHECK_ENABLE_AMD_MMCONF;
         return 0;
 }
 
-static const struct dmi_system_id __cpuinitconst mmconf_dmi_table[] = {
+static const struct dmi_system_id __initconst mmconf_dmi_table[] = {
         {
                 .callback = set_check_enable_amd_mmconf,
                 .ident = "Sun Microsystems Machine",

arch/x86/kernel/mmconf-fam10h_64.c static const struct dmi_system_id __cpui · line 241

Quoted 9 lines
arch/x86/kernel/mmconf-fam10h_64.c +2 -1
@@ -234,7 +234,8 @@ static const struct dmi_system_id __cpui
 	{}
 };
 
-void __cpuinit check_enable_amd_mmconf_dmi(void)
+/* Called from a __cpuinit function, but only on the BSP. */
+void __ref check_enable_amd_mmconf_dmi(void)
 {
 	dmi_check_system(mmconf_dmi_table);
 }