2008-02-17 12:12:59

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 0/27] fix section mismatches

Following patch set fix all section mismatches for a
allnoconfig, allyesconfig, defconfig build of x86 - 64bit.
The builds were all done with CONFIG_DEBUG_SECTION_MISMATCH
enabled.

The fixes are spread all over the tree but none of them are
invasive in nature.
diffstat for the full patchset reports:
33 files changed, 58 insertions(+), 58 deletions(-)

A total of 66 section mismatch warnings are fixed.

I have for each patch tried to identify the relevant persons
and added them to Cc.

Andrew - can we suck it all into -mm or do you have other
preferences? I expect over time the respective maintainers
will pick up the patches, review them and apply them.
(Call me naive).

Patches will follow and the full diff is included below for
easier review.


And before anyone ask... I started out with x86 64bit but I
plan to take a look at other architectures when these are
in mainline. But do not wait for me - please fix the
warning yourself.

Sam


Sam Ravnborg (27):
serial: silence section mismatch warnings in 8250_pci
rtc: silence section mismatch warning in rtc-test
pcmcia: silence section mismatch warnings from class_interface variables
pcmcia: silence section mismatch warnings from pci_driver variables
cpu: fix section mismatch warnings in hotcpu_register
cpu: fix section mismatch warning in unregister_cpu_notifier
cpu: fix section mismatch warnings in *cpu_down
cpu: fix section mismatch warning in reference to register_cpu_notifier
x86: fix section mismatch warning in setup_64.c:nearby_node
x86: fix section mismatch in setup_64.c:srat_detect_node
acpi: fix section mismatch in processor_core.c:acpi_processor_hotplug_notify
x86: fix section mismatch warning in topology.c:arch_register_cpu
drivers/base/cpu: fix section mismatch in cpu.c:store_online
hwmon: fix section mismatch in coretemp
cpufreq: fix section mismatch warnings
scsi: fix section mismatch in aic94xx
acer-wmi: fix section mismatch warnings
video: fix section mismatch warnings in uvesafb
tpm: fix section mismatch warning
[ALSA] caiaq - fix section mismatch warning
x86: fix section mismatch in srat_64.c:reserve_hotadd
x86: fix section mismatch in head_64.S:initial_code
x86: annotate pci/common.s:pci_scan_bus_with_sysdata with __devinit
pcmcia: annotate cb_alloc with __ref
pci: fix section mismatch warning in pci_scan_child_bus
acpi: fix section mismatch in acpi_pci_root_add
[ALSA] hdsp - fix section mismatch warnings


arch/x86/kernel/head_64.S | 2 +-
arch/x86/kernel/setup_64.c | 4 ++--
arch/x86/kernel/topology.c | 2 +-
arch/x86/mm/srat_64.c | 2 +-
arch/x86/pci/common.c | 2 +-
drivers/acpi/pci_root.c | 2 +-
drivers/acpi/processor_core.c | 4 ++--
drivers/base/cpu.c | 4 ++--
drivers/char/tpm/tpm_nsc.c | 2 +-
drivers/cpufreq/cpufreq.c | 2 +-
drivers/cpufreq/cpufreq_stats.c | 2 +-
drivers/hwmon/coretemp.c | 4 ++--
drivers/misc/acer-wmi.c | 6 +++---
drivers/pci/hotplug-pci.c | 2 +-
drivers/pci/hotplug/acpiphp_glue.c | 2 +-
drivers/pci/hotplug/cpci_hotplug_pci.c | 2 +-
drivers/pci/hotplug/pciehp_pci.c | 2 +-
drivers/pci/hotplug/shpchp_pci.c | 2 +-
drivers/pci/probe.c | 8 ++++----
drivers/pcmcia/cardbus.c | 2 +-
drivers/pcmcia/ds.c | 2 +-
drivers/pcmcia/i82092.c | 6 +++---
drivers/pcmcia/pd6729.c | 6 +++---
drivers/pcmcia/rsrc_nonstatic.c | 2 +-
drivers/pcmcia/socket_sysfs.c | 2 +-
drivers/rtc/rtc-test.c | 8 ++++----
drivers/scsi/aic94xx/aic94xx_init.c | 4 ++--
drivers/serial/8250_pci.c | 2 +-
drivers/video/uvesafb.c | 2 +-
include/linux/cpu.h | 2 +-
kernel/cpu.c | 10 +++++-----
sound/pci/rme9652/hdsp.c | 6 +++---
sound/usb/caiaq/caiaq-device.c | 6 +++---
33 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 09b38d5..220daaa 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -250,7 +250,7 @@ ENTRY(secondary_startup_64)
lretq

/* SMP bootup changes these two */
- __CPUINITDATA
+ __REFDATA
.align 8
ENTRY(initial_code)
.quad x86_64_start_kernel
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index c0d8208..e186617 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -518,7 +518,7 @@ static void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
}

#ifdef CONFIG_NUMA
-static int nearby_node(int apicid)
+static int __cpuinit nearby_node(int apicid)
{
int i, node;

@@ -791,7 +791,7 @@ static int __cpuinit intel_num_cpu_cores(struct cpuinfo_x86 *c)
return 1;
}

-static void srat_detect_node(void)
+static void __cpuinit srat_detect_node(void)
{
#ifdef CONFIG_NUMA
unsigned node;
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index a40051b..0fcc95a 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -34,7 +34,7 @@
static DEFINE_PER_CPU(struct x86_cpu, cpu_devices);

#ifdef CONFIG_HOTPLUG_CPU
-int arch_register_cpu(int num)
+int __ref arch_register_cpu(int num)
{
/*
* CPU0 cannot be offlined due to several
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index ecd91ea..70eb153 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -166,7 +166,7 @@ static inline int save_add_info(void) {return 0;}
* Both SPARSE and RESERVE need nodes_add information.
* This code supports one contiguous hot add area per node.
*/
-static int reserve_hotadd(int node, unsigned long start, unsigned long end)
+static int __init reserve_hotadd(int node, unsigned long start, unsigned long end)
{
unsigned long s_pfn = start >> PAGE_SHIFT;
unsigned long e_pfn = end >> PAGE_SHIFT;
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index b7c67a1..7b6e3bb 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -541,7 +541,7 @@ void pcibios_disable_device (struct pci_dev *dev)
pcibios_disable_irq(dev);
}

-struct pci_bus *pci_scan_bus_with_sysdata(int busno)
+struct pci_bus *__devinit pci_scan_bus_with_sysdata(int busno)
{
struct pci_bus *bus = NULL;
struct pci_sysdata *sd;
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index f14ff1f..c3fed31 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -184,7 +184,7 @@ static void acpi_pci_bridge_scan(struct acpi_device *device)
}
}

-static int acpi_pci_root_add(struct acpi_device *device)
+static int __devinit acpi_pci_root_add(struct acpi_device *device)
{
int result = 0;
struct acpi_pci_root *root = NULL;
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 75ccf5d..d3cc07f 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -881,8 +881,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
return 0;
}

-static void
-acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
+static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
+ u32 event, void *data)
{
struct acpi_processor *pr;
struct acpi_device *device = NULL;
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 499b003..3e417a9 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -28,7 +28,7 @@ static ssize_t show_online(struct sys_device *dev, char *buf)
return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id));
}

-static ssize_t store_online(struct sys_device *dev, const char *buf,
+static ssize_t __ref store_online(struct sys_device *dev, const char *buf,
size_t count)
{
struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -55,7 +55,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
}
static SYSDEV_ATTR(online, 0644, show_online, store_online);

-static void __devinit register_cpu_control(struct cpu *cpu)
+static void __cpuinit register_cpu_control(struct cpu *cpu)
{
sysdev_create_file(&cpu->sysdev, &attr_online);
}
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 6313326..ab18c1e 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -264,7 +264,7 @@ static const struct tpm_vendor_specific tpm_nsc = {

static struct platform_device *pdev = NULL;

-static void __devexit tpm_nsc_remove(struct device *dev)
+static void tpm_nsc_remove(struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
if ( chip ) {
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 64926aa..c45768a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1783,7 +1783,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

-static struct notifier_block __cpuinitdata cpufreq_cpu_notifier =
+static struct notifier_block __refdata cpufreq_cpu_notifier =
{
.notifier_call = cpufreq_cpu_callback,
};
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 1b8312b..070421a 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

-static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata =
+static struct notifier_block cpufreq_stat_cpu_notifier __refdata =
{
.notifier_call = cpufreq_stat_cpu_callback,
};
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 3ee60d2..1439432 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -330,7 +330,7 @@ static void coretemp_device_remove(unsigned int cpu)
mutex_unlock(&pdev_list_mutex);
}

-static int coretemp_cpu_callback(struct notifier_block *nfb,
+static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long) hcpu;
@@ -347,7 +347,7 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

-static struct notifier_block coretemp_cpu_notifier = {
+static struct notifier_block coretemp_cpu_notifier __refdata = {
.notifier_call = coretemp_cpu_callback,
};
#endif /* !CONFIG_HOTPLUG_CPU */
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index d7aea93..cdc733b 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -756,7 +756,7 @@ static struct led_classdev mail_led = {
.brightness_set = mail_led_set,
};

-static int __init acer_led_init(struct device *dev)
+static int __devinit acer_led_init(struct device *dev)
{
return led_classdev_register(dev, &mail_led);
}
@@ -789,7 +789,7 @@ static struct backlight_ops acer_bl_ops = {
.update_status = update_bl_status,
};

-static int __init acer_backlight_init(struct device *dev)
+static int __devinit acer_backlight_init(struct device *dev)
{
struct backlight_device *bd;

@@ -808,7 +808,7 @@ static int __init acer_backlight_init(struct device *dev)
return 0;
}

-static void __exit acer_backlight_exit(void)
+static void acer_backlight_exit(void)
{
backlight_device_unregister(acer_backlight_device);
}
diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c
index a590ef6..4d4a644 100644
--- a/drivers/pci/hotplug-pci.c
+++ b/drivers/pci/hotplug-pci.c
@@ -4,7 +4,7 @@
#include "pci.h"


-unsigned int pci_do_scan_bus(struct pci_bus *bus)
+unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
{
unsigned int max;

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cf22f9e..5e50008 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -1085,7 +1085,7 @@ static int acpiphp_bus_trim(acpi_handle handle)
* This function should be called per *physical slot*,
* not per each slot object in ACPI namespace.
*/
-static int enable_device(struct acpiphp_slot *slot)
+static int __ref enable_device(struct acpiphp_slot *slot)
{
struct pci_dev *dev;
struct pci_bus *bus = slot->bridge->pci_bus;
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 5e9be44..dddac96 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -250,7 +250,7 @@ int cpci_led_off(struct slot* slot)
* Device configuration functions
*/

-int cpci_configure_slot(struct slot* slot)
+int __ref cpci_configure_slot(struct slot* slot)
{
struct pci_bus *parent;
int fn;
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index dd50713..9372a84 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -167,7 +167,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
}
}

-static int pciehp_add_bridge(struct pci_dev *dev)
+static int __ref pciehp_add_bridge(struct pci_dev *dev)
{
struct pci_bus *parent = dev->bus;
int pass, busnr, start = parent->secondary;
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 0a6b25e..a69a215 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -96,7 +96,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
}
}

-int shpchp_configure_device(struct slot *p_slot)
+int __ref shpchp_configure_device(struct slot *p_slot)
{
struct pci_dev *dev;
struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4d23b9f..5ffd610 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -286,7 +286,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
}
}

-void pci_read_bridge_bases(struct pci_bus *child)
+void __devinit pci_read_bridge_bases(struct pci_bus *child)
{
struct pci_dev *dev = child->self;
u8 io_base_lo, io_limit_lo;
@@ -472,7 +472,7 @@ static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
* them, we proceed to assigning numbers to the remaining buses in
* order to avoid overlaps between old and new bus numbers.
*/
-int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass)
+int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass)
{
struct pci_bus *child;
int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
@@ -1008,7 +1008,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
return nr;
}

-unsigned int pci_scan_child_bus(struct pci_bus *bus)
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
{
unsigned int devfn, pass, max = bus->secondary;
struct pci_dev *dev;
@@ -1116,7 +1116,7 @@ err_out:
return NULL;
}

-struct pci_bus *pci_scan_bus_parented(struct device *parent,
+struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
int bus, struct pci_ops *ops, void *sysdata)
{
struct pci_bus *b;
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 714baae..fb2f38d 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -209,7 +209,7 @@ static void cardbus_assign_irqs(struct pci_bus *bus, int irq)
}
}

-int cb_alloc(struct pcmcia_socket * s)
+int __ref cb_alloc(struct pcmcia_socket * s)
{
struct pci_bus *bus = s->cb_dev->subordinate;
struct pci_dev *dev;
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 5a85871..e407754 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1520,7 +1520,7 @@ static void pcmcia_bus_remove_socket(struct device *dev,


/* the pcmcia_bus_interface is used to handle pcmcia socket devices */
-static struct class_interface pcmcia_bus_interface = {
+static struct class_interface pcmcia_bus_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pcmcia_bus_add_socket,
.remove_dev = &pcmcia_bus_remove_socket,
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index 7495155..1b3749e 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -53,7 +53,7 @@ static int i82092aa_socket_resume (struct pci_dev *dev)
}
#endif

-static struct pci_driver i82092aa_pci_drv = {
+static struct pci_driver i82092aa_pci_driver = {
.name = "i82092aa",
.id_table = i82092aa_pci_ids,
.probe = i82092aa_pci_probe,
@@ -709,13 +709,13 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_

static int i82092aa_module_init(void)
{
- return pci_register_driver(&i82092aa_pci_drv);
+ return pci_register_driver(&i82092aa_pci_driver);
}

static void i82092aa_module_exit(void)
{
enter("i82092aa_module_exit");
- pci_unregister_driver(&i82092aa_pci_drv);
+ pci_unregister_driver(&i82092aa_pci_driver);
if (sockets[0].io_base>0)
release_region(sockets[0].io_base, 2);
leave("i82092aa_module_exit");
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index abc10fe..8bed1da 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -778,7 +778,7 @@ static struct pci_device_id pd6729_pci_ids[] = {
};
MODULE_DEVICE_TABLE(pci, pd6729_pci_ids);

-static struct pci_driver pd6729_pci_drv = {
+static struct pci_driver pd6729_pci_driver = {
.name = "pd6729",
.id_table = pd6729_pci_ids,
.probe = pd6729_pci_probe,
@@ -791,12 +791,12 @@ static struct pci_driver pd6729_pci_drv = {

static int pd6729_module_init(void)
{
- return pci_register_driver(&pd6729_pci_drv);
+ return pci_register_driver(&pd6729_pci_driver);
}

static void pd6729_module_exit(void)
{
- pci_unregister_driver(&pd6729_pci_drv);
+ pci_unregister_driver(&pd6729_pci_driver);
}

module_init(pd6729_module_init);
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index a8d1007..0fcf763 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -1045,7 +1045,7 @@ static void __devexit pccard_sysfs_remove_rsrc(struct device *dev,
device_remove_file(dev, *attr);
}

-static struct class_interface pccard_rsrc_interface = {
+static struct class_interface pccard_rsrc_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pccard_sysfs_add_rsrc,
.remove_dev = __devexit_p(&pccard_sysfs_remove_rsrc),
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c
index b440900..4677286 100644
--- a/drivers/pcmcia/socket_sysfs.c
+++ b/drivers/pcmcia/socket_sysfs.c
@@ -403,7 +403,7 @@ static void __devexit pccard_sysfs_remove_socket(struct device *dev,
device_remove_file(dev, *attr);
}

-struct class_interface pccard_sysfs_interface = {
+struct class_interface pccard_sysfs_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pccard_sysfs_add_socket,
.remove_dev = __devexit_p(&pccard_sysfs_remove_socket),
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 254c9fc..bc93002 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -147,7 +147,7 @@ static int __devexit test_remove(struct platform_device *plat_dev)
return 0;
}

-static struct platform_driver test_drv = {
+static struct platform_driver test_driver = {
.probe = test_probe,
.remove = __devexit_p(test_remove),
.driver = {
@@ -160,7 +160,7 @@ static int __init test_init(void)
{
int err;

- if ((err = platform_driver_register(&test_drv)))
+ if ((err = platform_driver_register(&test_driver)))
return err;

if ((test0 = platform_device_alloc("rtc-test", 0)) == NULL) {
@@ -191,7 +191,7 @@ exit_free_test0:
platform_device_put(test0);

exit_driver_unregister:
- platform_driver_unregister(&test_drv);
+ platform_driver_unregister(&test_driver);
return err;
}

@@ -199,7 +199,7 @@ static void __exit test_exit(void)
{
platform_device_unregister(test0);
platform_device_unregister(test1);
- platform_driver_unregister(&test_drv);
+ platform_driver_unregister(&test_driver);
}

MODULE_AUTHOR("Alessandro Zummo <[email protected]>");
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 5d761eb..720812f 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -531,10 +531,10 @@ static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
/* The first entry, 0, is used for dynamic ids, the rest for devices
* we know about.
*/
-static struct asd_pcidev_struct {
+static const struct asd_pcidev_struct {
const char * name;
int (*setup)(struct asd_ha_struct *asd_ha);
-} asd_pcidev_data[] = {
+} asd_pcidev_data[] __devinitconst = {
/* Id 0 is used for dynamic ids. */
{ .name = "Adaptec AIC-94xx SAS/SATA Host Adapter",
.setup = asd_aic9410_setup
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index a8bec49..c4b77a5 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -775,7 +775,7 @@ pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
* This list is ordered alphabetically by vendor then device.
* Specific entries must come before more generic entries.
*/
-static struct pci_serial_quirk pci_serial_quirks[] = {
+static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
/*
* ADDI-DATA GmbH communication cards <[email protected]>
*/
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index be27b9c..2fb5bb8 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -44,7 +44,7 @@ static struct fb_fix_screeninfo uvesafb_fix __devinitdata = {

static int mtrr __devinitdata = 3; /* enable mtrr by default */
static int blank = 1; /* enable blanking by default */
-static int ypan __devinitdata = 1; /* 0: scroll, 1: ypan, 2: ywrap */
+static int ypan = 1; /* 0: scroll, 1: ypan, 2: ywrap */
static int pmi_setpal __devinitdata = 1; /* use PMI for palette changes */
static int nocrtc __devinitdata; /* ignore CRTC settings */
static int noedid __devinitdata; /* don't try DDC transfers */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0be8d65..237c19a 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -109,7 +109,7 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
extern void get_online_cpus(void);
extern void put_online_cpus(void);
#define hotcpu_notifier(fn, pri) { \
- static struct notifier_block fn##_nb = \
+ static struct notifier_block fn##_nb __cpuinitdata = \
{ .notifier_call = fn, .priority = pri }; \
register_cpu_notifier(&fn##_nb); \
}
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 2eff3f6..329fdcb 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -136,7 +136,7 @@ static void cpu_hotplug_done(void)
mutex_unlock(&cpu_hotplug.lock);
}
/* Need to know about CPUs going up/down? */
-int __cpuinit register_cpu_notifier(struct notifier_block *nb)
+int __ref register_cpu_notifier(struct notifier_block *nb)
{
int ret;
cpu_maps_update_begin();
@@ -149,7 +149,7 @@ int __cpuinit register_cpu_notifier(struct notifier_block *nb)

EXPORT_SYMBOL(register_cpu_notifier);

-void unregister_cpu_notifier(struct notifier_block *nb)
+void __ref unregister_cpu_notifier(struct notifier_block *nb)
{
cpu_maps_update_begin();
raw_notifier_chain_unregister(&cpu_chain, nb);
@@ -180,7 +180,7 @@ struct take_cpu_down_param {
};

/* Take this CPU down. */
-static int take_cpu_down(void *_param)
+static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
int err;
@@ -199,7 +199,7 @@ static int take_cpu_down(void *_param)
}

/* Requires cpu_add_remove_lock to be held */
-static int _cpu_down(unsigned int cpu, int tasks_frozen)
+static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
{
int err, nr_calls = 0;
struct task_struct *p;
@@ -274,7 +274,7 @@ out_release:
return err;
}

-int cpu_down(unsigned int cpu)
+int __ref cpu_down(unsigned int cpu)
{
int err = 0;

diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index c2bd438..6f07a25 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -745,7 +745,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)


#ifdef HDSP_FW_LOADER
-static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp);
+static int hdsp_request_fw_loader(struct hdsp *hdsp);
#endif

static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
@@ -4688,7 +4688,7 @@ static struct snd_pcm_ops snd_hdsp_capture_ops = {
.copy = snd_hdsp_capture_copy,
};

-static int __devinit snd_hdsp_create_hwdep(struct snd_card *card,
+static int snd_hdsp_create_hwdep(struct snd_card *card,
struct hdsp *hdsp)
{
struct snd_hwdep *hw;
@@ -4857,7 +4857,7 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp

#ifdef HDSP_FW_LOADER
/* load firmware via hotplug fw loader */
-static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp)
+static int hdsp_request_fw_loader(struct hdsp *hdsp)
{
const char *fwfile;
const struct firmware *fw;
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c
index 58d25e4..7c44a2c 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/caiaq-device.c
@@ -245,7 +245,7 @@ int snd_usb_caiaq_set_auto_msg (struct snd_usb_caiaqdev *dev,
tmp, sizeof(tmp));
}

-static void setup_card(struct snd_usb_caiaqdev *dev)
+static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
{
int ret;
char val[4];
@@ -359,7 +359,7 @@ static struct snd_card* create_card(struct usb_device* usb_dev)
return card;
}

-static int init_card(struct snd_usb_caiaqdev *dev)
+static int __devinit init_card(struct snd_usb_caiaqdev *dev)
{
char *c;
struct usb_device *usb_dev = dev->chip.dev;
@@ -428,7 +428,7 @@ static int init_card(struct snd_usb_caiaqdev *dev)
return 0;
}

-static int snd_probe(struct usb_interface *intf,
+static int __devinit snd_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
int ret;


2008-02-17 12:23:13

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 02/27] rtc: silence section mismatch warning in rtc-test

Fix following warning:
WARNING: vmlinux.o(.data+0x253e28): Section mismatch in reference from the variable test_drv to the function .devexit.text:test_remove()

Fix by renaming the platfrom_driver variable from *_drv to *_driver
so modpost ignore the reference to an __devexit section.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Alessandro Zummo <[email protected]>
---
drivers/rtc/rtc-test.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 254c9fc..bc93002 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -147,7 +147,7 @@ static int __devexit test_remove(struct platform_device *plat_dev)
return 0;
}

-static struct platform_driver test_drv = {
+static struct platform_driver test_driver = {
.probe = test_probe,
.remove = __devexit_p(test_remove),
.driver = {
@@ -160,7 +160,7 @@ static int __init test_init(void)
{
int err;

- if ((err = platform_driver_register(&test_drv)))
+ if ((err = platform_driver_register(&test_driver)))
return err;

if ((test0 = platform_device_alloc("rtc-test", 0)) == NULL) {
@@ -191,7 +191,7 @@ exit_free_test0:
platform_device_put(test0);

exit_driver_unregister:
- platform_driver_unregister(&test_drv);
+ platform_driver_unregister(&test_driver);
return err;
}

@@ -199,7 +199,7 @@ static void __exit test_exit(void)
{
platform_device_unregister(test0);
platform_device_unregister(test1);
- platform_driver_unregister(&test_drv);
+ platform_driver_unregister(&test_driver);
}

MODULE_AUTHOR("Alessandro Zummo <[email protected]>");
--
1.5.4.rc3.14.g44397

2008-02-17 12:23:35

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 04/27] pcmcia: silence section mismatch warnings from pci_driver variables

Silence following warnings:
WARNING: drivers/pcmcia/built-in.o(.data+0x14e0): Section mismatch in reference from the variable pd6729_pci_drv to the function .devinit.text:pd6729_pci_probe()
WARNING: drivers/pcmcia/built-in.o(.data+0x14e8): Section mismatch in reference from the variable pd6729_pci_drv to the function .devexit.text:pd6729_pci_remove()
WARNING: drivers/pcmcia/built-in.o(.data+0x16c0): Section mismatch in reference from the variable i82092aa_pci_drv to the function .devinit.text:i82092aa_pci_probe()
WARNING: drivers/pcmcia/built-in.o(.data+0x16c8): Section mismatch in reference from the variable i82092aa_pci_drv to the function .devexit.text:i82092aa_pci_remove()

Rename the variables from *_drv to *_driver so
modpost ignore the OK references to __devinit/__devexit
functions.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Dominik Brodowski <[email protected]>
---
drivers/pcmcia/i82092.c | 6 +++---
drivers/pcmcia/pd6729.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index 7495155..1b3749e 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -53,7 +53,7 @@ static int i82092aa_socket_resume (struct pci_dev *dev)
}
#endif

-static struct pci_driver i82092aa_pci_drv = {
+static struct pci_driver i82092aa_pci_driver = {
.name = "i82092aa",
.id_table = i82092aa_pci_ids,
.probe = i82092aa_pci_probe,
@@ -709,13 +709,13 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_

static int i82092aa_module_init(void)
{
- return pci_register_driver(&i82092aa_pci_drv);
+ return pci_register_driver(&i82092aa_pci_driver);
}

static void i82092aa_module_exit(void)
{
enter("i82092aa_module_exit");
- pci_unregister_driver(&i82092aa_pci_drv);
+ pci_unregister_driver(&i82092aa_pci_driver);
if (sockets[0].io_base>0)
release_region(sockets[0].io_base, 2);
leave("i82092aa_module_exit");
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index abc10fe..8bed1da 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -778,7 +778,7 @@ static struct pci_device_id pd6729_pci_ids[] = {
};
MODULE_DEVICE_TABLE(pci, pd6729_pci_ids);

-static struct pci_driver pd6729_pci_drv = {
+static struct pci_driver pd6729_pci_driver = {
.name = "pd6729",
.id_table = pd6729_pci_ids,
.probe = pd6729_pci_probe,
@@ -791,12 +791,12 @@ static struct pci_driver pd6729_pci_drv = {

static int pd6729_module_init(void)
{
- return pci_register_driver(&pd6729_pci_drv);
+ return pci_register_driver(&pd6729_pci_driver);
}

static void pd6729_module_exit(void)
{
- pci_unregister_driver(&pd6729_pci_drv);
+ pci_unregister_driver(&pd6729_pci_driver);
}

module_init(pd6729_module_init);
--
1.5.4.rc3.14.g44397

2008-02-17 12:23:50

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 08/27] cpu: fix section mismatch warning in reference to register_cpu_notifier

Fix following warnings:
WARNING: vmlinux.o(.text+0xc60): Section mismatch in reference from the function kvm_init() to the function .cpuinit.text:register_cpu_notifier()
WARNING: vmlinux.o(.text+0x33869a): Section mismatch in reference from the function xfs_icsb_init_counters() to the function .cpuinit.text:register_cpu_notifier()
WARNING: vmlinux.o(.text+0x5556a1): Section mismatch in reference from the function acpi_processor_install_hotplug_notify() to the function .cpuinit.text:register_cpu_notifier()
WARNING: vmlinux.o(.text+0xfe6b28): Section mismatch in reference from the function cpufreq_register_driver() to the function .cpuinit.text:register_cpu_notifier()

register_cpu_notifier() are only really defined when HOTPLUG_CPU
is enabled. So references to the function are OK.
Annotate it with __ref so we do not get warnings from
callers and do not get warnings for the functions/data
used by register_cpu_notifier().

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Gautham R Shenoy <[email protected]>
---
kernel/cpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 74827bf..329fdcb 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -136,7 +136,7 @@ static void cpu_hotplug_done(void)
mutex_unlock(&cpu_hotplug.lock);
}
/* Need to know about CPUs going up/down? */
-int __cpuinit register_cpu_notifier(struct notifier_block *nb)
+int __ref register_cpu_notifier(struct notifier_block *nb)
{
int ret;
cpu_maps_update_begin();
--
1.5.4.rc3.14.g44397

2008-02-17 12:24:14

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 03/27] pcmcia: silence section mismatch warnings from class_interface variables

Silence the following warnings:
WARNING: drivers/pcmcia/built-in.o(.data+0x348): Section mismatch in reference from the variable pccard_sysfs_interface to the function .devinit.text:pccard_sysfs_add_socket()
WARNING: drivers/pcmcia/built-in.o(.data+0x350): Section mismatch in reference from the variable pccard_sysfs_interface to the function .devexit.text:pccard_sysfs_remove_socket()
WARNING: drivers/pcmcia/built-in.o(.data+0x6e8): Section mismatch in reference from the variable pcmcia_bus_interface to the function .devinit.text:pcmcia_bus_add_socket()
WARNING: drivers/pcmcia/built-in.o(.data+0xa88): Section mismatch in reference from the variable pccard_rsrc_interface to the function .devinit.text:pccard_sysfs_add_rsrc()
WARNING: drivers/pcmcia/built-in.o(.data+0xa90): Section mismatch in reference from the variable pccard_rsrc_interface to the function .devexit.text:pccard_sysfs_remove_rsrc()

The variables of type class_interface contains references
to __devinit and __devexit functions which is OK.
Silence warnings by annotating the variables with __refdata.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Dominik Brodowski <[email protected]>
---
drivers/pcmcia/ds.c | 2 +-
drivers/pcmcia/rsrc_nonstatic.c | 2 +-
drivers/pcmcia/socket_sysfs.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 5a85871..e407754 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1520,7 +1520,7 @@ static void pcmcia_bus_remove_socket(struct device *dev,


/* the pcmcia_bus_interface is used to handle pcmcia socket devices */
-static struct class_interface pcmcia_bus_interface = {
+static struct class_interface pcmcia_bus_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pcmcia_bus_add_socket,
.remove_dev = &pcmcia_bus_remove_socket,
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index a8d1007..0fcf763 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -1045,7 +1045,7 @@ static void __devexit pccard_sysfs_remove_rsrc(struct device *dev,
device_remove_file(dev, *attr);
}

-static struct class_interface pccard_rsrc_interface = {
+static struct class_interface pccard_rsrc_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pccard_sysfs_add_rsrc,
.remove_dev = __devexit_p(&pccard_sysfs_remove_rsrc),
diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c
index b440900..4677286 100644
--- a/drivers/pcmcia/socket_sysfs.c
+++ b/drivers/pcmcia/socket_sysfs.c
@@ -403,7 +403,7 @@ static void __devexit pccard_sysfs_remove_socket(struct device *dev,
device_remove_file(dev, *attr);
}

-struct class_interface pccard_sysfs_interface = {
+struct class_interface pccard_sysfs_interface __refdata = {
.class = &pcmcia_socket_class,
.add_dev = &pccard_sysfs_add_socket,
.remove_dev = __devexit_p(&pccard_sysfs_remove_socket),
--
1.5.4.rc3.14.g44397

2008-02-17 12:24:33

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 11/27] acpi: fix section mismatch in processor_core.c:acpi_processor_hotplug_notify

Fix following warning:
WARNING: vmlinux.o(.text+0x55586c): Section mismatch in reference from the function acpi_processor_hotplug_notify() to the function .cpuinit.text:acpi_processor_start()

acpi_processor_hotplug_notify() may safely reference __cpuinit
stuff as it ids defined inside an ACPI_HOTPLUG_CPU block.
So annotate it __ref to silence the warning.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Len Brown <[email protected]>
---
drivers/acpi/processor_core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 75ccf5d..d3cc07f 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -881,8 +881,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
return 0;
}

-static void
-acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
+static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
+ u32 event, void *data)
{
struct acpi_processor *pr;
struct acpi_device *device = NULL;
--
1.5.4.rc3.14.g44397

2008-02-17 12:24:50

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 06/27] cpu: fix section mismatch warning in unregister_cpu_notifier

Fix following warning:
WARNING: vmlinux.o(.text+0x75f4e): Section mismatch in reference from the function unregister_cpu_notifier() to the variable .cpuinit.data:cpu_chain

We know that unregister_cpu_notifier is using HOTPLUG_CPU
stuff - so ignore these references.
Annotating unregister_cpu_notifier had been another option
but this caused far more warnings since not all callers were
annotated __cpuinit.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Gautham R Shenoy <[email protected]>
---
kernel/cpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 2eff3f6..cdebf33 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -149,7 +149,7 @@ int __cpuinit register_cpu_notifier(struct notifier_block *nb)

EXPORT_SYMBOL(register_cpu_notifier);

-void unregister_cpu_notifier(struct notifier_block *nb)
+void __ref unregister_cpu_notifier(struct notifier_block *nb)
{
cpu_maps_update_begin();
raw_notifier_chain_unregister(&cpu_chain, nb);
--
1.5.4.rc3.14.g44397

2008-02-17 12:25:17

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 07/27] cpu: fix section mismatch warnings in *cpu_down

Fix following warnings:
WARNING: vmlinux.o(.text+0x75c8d): Section mismatch in reference from the function take_cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: vmlinux.o(.text+0x75d2a): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: vmlinux.o(.text+0x75d4d): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: vmlinux.o(.text+0x75de4): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain
WARNING: vmlinux.o(.text+0x75e33): Section mismatch in reference from the function _cpu_down() to the variable .cpuinit.data:cpu_chain

cpu_down is only used from code surrounded by HOTPLUG_CPU
so any references to __cpuinit is OK.
Add a few __ref to tech modpost to ignore the references.

This is just papering over the fact that the cpu hotplug
code is fragile with respect to use of HOTPLUG_CPU and
in many cases rely on __cpuinit to get rid of code
when HOTPLUG_CPU is not enabled.
For now this is the least invasive change.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Gautham R Shenoy <[email protected]>
---
kernel/cpu.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index cdebf33..74827bf 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -180,7 +180,7 @@ struct take_cpu_down_param {
};

/* Take this CPU down. */
-static int take_cpu_down(void *_param)
+static int __ref take_cpu_down(void *_param)
{
struct take_cpu_down_param *param = _param;
int err;
@@ -199,7 +199,7 @@ static int take_cpu_down(void *_param)
}

/* Requires cpu_add_remove_lock to be held */
-static int _cpu_down(unsigned int cpu, int tasks_frozen)
+static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
{
int err, nr_calls = 0;
struct task_struct *p;
@@ -274,7 +274,7 @@ out_release:
return err;
}

-int cpu_down(unsigned int cpu)
+int __ref cpu_down(unsigned int cpu)
{
int err = 0;

--
1.5.4.rc3.14.g44397

2008-02-17 12:25:40

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 13/27] drivers/base/cpu: fix section mismatch in cpu.c:store_online

Fix following warning:
WARNING: vmlinux.o(.text+0x64609c): Section mismatch in reference from the function store_online() to the function .cpuinit.text:cpu_up()

store_online() is defined inside a HOTPLUG_CPU block
so references are OK. Ignore references by annotating
store_online() with __ref.

Note: This is needed because cpu_up() most likely should
not have been __cpuinit but all the hotplug cpu code
misuses the __cpuinit annotation.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/base/cpu.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 499b003..3e417a9 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -28,7 +28,7 @@ static ssize_t show_online(struct sys_device *dev, char *buf)
return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id));
}

-static ssize_t store_online(struct sys_device *dev, const char *buf,
+static ssize_t __ref store_online(struct sys_device *dev, const char *buf,
size_t count)
{
struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -55,7 +55,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
}
static SYSDEV_ATTR(online, 0644, show_online, store_online);

-static void __devinit register_cpu_control(struct cpu *cpu)
+static void __cpuinit register_cpu_control(struct cpu *cpu)
{
sysdev_create_file(&cpu->sysdev, &attr_online);
}
--
1.5.4.rc3.14.g44397

2008-02-17 12:25:56

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 19/27] tpm: fix section mismatch warning

Fix following warning:
WARNING: vmlinux.o(.init.text+0x32804): Section mismatch in reference from the function init_nsc() to the function .devexit.text:tpm_nsc_remove()

The function tpm_nsc_remove() are used outside __exit,
so remove the __exit annotation to make sure the
function is always avilable.

Note: Trying to compare this module with other users of
platform_device gve me the impression that this driver
needs some work to match other users.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Kylene Hall <[email protected]>
---
drivers/char/tpm/tpm_nsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 6313326..ab18c1e 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -264,7 +264,7 @@ static const struct tpm_vendor_specific tpm_nsc = {

static struct platform_device *pdev = NULL;

-static void __devexit tpm_nsc_remove(struct device *dev)
+static void tpm_nsc_remove(struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
if ( chip ) {
--
1.5.4.rc3.14.g44397

2008-02-17 12:26:21

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 12/27] x86: fix section mismatch warning in topology.c:arch_register_cpu

Fix following warning:
WARNING: vmlinux.o(.text+0x1dfc3): Section mismatch in reference from the function arch_register_cpu() to the function .cpuinit.text:register_cpu()

arch_register_cpu() is only defined for HOTPLUG_CPU code
so simple fix is to ignore references by annotating the
function __ref.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/topology.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c
index a40051b..0fcc95a 100644
--- a/arch/x86/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
@@ -34,7 +34,7 @@
static DEFINE_PER_CPU(struct x86_cpu, cpu_devices);

#ifdef CONFIG_HOTPLUG_CPU
-int arch_register_cpu(int num)
+int __ref arch_register_cpu(int num)
{
/*
* CPU0 cannot be offlined due to several
--
1.5.4.rc3.14.g44397

2008-02-17 12:26:36

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 09/27] x86: fix section mismatch warning in setup_64.c:nearby_node

Fix following warnings:
WARNING: vmlinux.o(.text+0x1baa2): Section mismatch in reference from the function nearby_node() to the variable .cpuinit.data:apicid_to_node
WARNING: vmlinux.o(.text+0x1bace): Section mismatch in reference from the function nearby_node() to the variable .cpuinit.data:apicid_to_node

nearby_node() were only used by __cpuinit amd_detect_cmp()
So annotating nearby_node() __cpuinit was the trivial fix.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/setup_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index c0d8208..ff9029d 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -518,7 +518,7 @@ static void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
}

#ifdef CONFIG_NUMA
-static int nearby_node(int apicid)
+static int __cpuinit nearby_node(int apicid)
{
int i, node;

--
1.5.4.rc3.14.g44397

2008-02-17 12:26:53

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 14/27] hwmon: fix section mismatch in coretemp

Fix following warning:
WARNING: vmlinux.o(.text+0xebfd04): Section mismatch in reference from the function coretemp_cpu_callback() to the function .cpuinit.text:coretemp_device_add()

coretemp_cpu_callback() are only used inside a
HOTPLUG_CPU block so annotate it __cpuinit.
The notifier referencing the function are annotated
__refdata to silence warning from the exit function.
The unregister function do not use the embedded pointer
but clears the variable so the annotation is OK.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Mark M. Hoffman <[email protected]>
---
drivers/hwmon/coretemp.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 3ee60d2..1439432 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -330,7 +330,7 @@ static void coretemp_device_remove(unsigned int cpu)
mutex_unlock(&pdev_list_mutex);
}

-static int coretemp_cpu_callback(struct notifier_block *nfb,
+static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long) hcpu;
@@ -347,7 +347,7 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

-static struct notifier_block coretemp_cpu_notifier = {
+static struct notifier_block coretemp_cpu_notifier __refdata = {
.notifier_call = coretemp_cpu_callback,
};
#endif /* !CONFIG_HOTPLUG_CPU */
--
1.5.4.rc3.14.g44397

2008-02-17 12:27:18

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 18/27] video: fix section mismatch warnings in uvesafb

Fix following warnings:
WARNING: vmlinux.o(.text+0x51961b): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:mtrr
WARNING: vmlinux.o(.text+0x519641): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:mtrr
WARNING: vmlinux.o(.text+0x519664): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:pmi_setpal
WARNING: vmlinux.o(.text+0x51966a): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:pmi_setpal

The function param_set_scroll() referenced the variable
named ypan several times. modpost reported a bogus
variable name but removing the the __devinitdata
annotation of ypan fixed the above warnings.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Antonino Daplas <[email protected]>
Cc: Michal Januszewski <[email protected]>
---
drivers/video/uvesafb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index be27b9c..2fb5bb8 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -44,7 +44,7 @@ static struct fb_fix_screeninfo uvesafb_fix __devinitdata = {

static int mtrr __devinitdata = 3; /* enable mtrr by default */
static int blank = 1; /* enable blanking by default */
-static int ypan __devinitdata = 1; /* 0: scroll, 1: ypan, 2: ywrap */
+static int ypan = 1; /* 0: scroll, 1: ypan, 2: ywrap */
static int pmi_setpal __devinitdata = 1; /* use PMI for palette changes */
static int nocrtc __devinitdata; /* ignore CRTC settings */
static int noedid __devinitdata; /* don't try DDC transfers */
--
1.5.4.rc3.14.g44397

2008-02-17 12:27:36

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 24/27] pcmcia: annotate cb_alloc with __ref

cb_alloc() uses a function (pci_scan_slot) that will
be annotated __devinit.
Annotate cb_alloc() with __ref to tell modpost to ignore
this reference.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Dominik Brodowski <[email protected]>
---
drivers/pcmcia/cardbus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 714baae..fb2f38d 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -209,7 +209,7 @@ static void cardbus_assign_irqs(struct pci_bus *bus, int irq)
}
}

-int cb_alloc(struct pcmcia_socket * s)
+int __ref cb_alloc(struct pcmcia_socket * s)
{
struct pci_bus *bus = s->cb_dev->subordinate;
struct pci_dev *dev;
--
1.5.4.rc3.14.g44397

2008-02-17 12:27:53

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 21/27] x86: fix section mismatch in srat_64.c:reserve_hotadd

Fix following warning:
WARNING: vmlinux.o(.text+0x388cc): Section mismatch in reference from the function reserve_hotadd() to the function .init.text:absent_pages_in_range()

reserve_hotadd() are only used by __init acpi_numa_memory_affinity_init().
Annotate reserve_hotadd() with __init is the trivial fix.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/mm/srat_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index ecd91ea..70eb153 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -166,7 +166,7 @@ static inline int save_add_info(void) {return 0;}
* Both SPARSE and RESERVE need nodes_add information.
* This code supports one contiguous hot add area per node.
*/
-static int reserve_hotadd(int node, unsigned long start, unsigned long end)
+static int __init reserve_hotadd(int node, unsigned long start, unsigned long end)
{
unsigned long s_pfn = start >> PAGE_SHIFT;
unsigned long e_pfn = end >> PAGE_SHIFT;
--
1.5.4.rc3.14.g44397

2008-02-17 12:28:21

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 27/27] [ALSA] hdsp - fix section mismatch warnings

Fix following warnings:
WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x34bc): Section mismatch in reference from the function hdsp_check_for_firmware() to the function .devinit.text:hdsp_request_fw_loader()
WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x4ac6): Section mismatch in reference from the function snd_hdsp_proc_read() to the function .devinit.text:hdsp_request_fw_loader()

Calling hdsp_request_fw_loader() were triggered from /proc
so this is not restricted to init or hotplug.
So removing the __devexit annotation of this function
and one of the functions fix the warning.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
---
sound/pci/rme9652/hdsp.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index c2bd438..6f07a25 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -745,7 +745,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)


#ifdef HDSP_FW_LOADER
-static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp);
+static int hdsp_request_fw_loader(struct hdsp *hdsp);
#endif

static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
@@ -4688,7 +4688,7 @@ static struct snd_pcm_ops snd_hdsp_capture_ops = {
.copy = snd_hdsp_capture_copy,
};

-static int __devinit snd_hdsp_create_hwdep(struct snd_card *card,
+static int snd_hdsp_create_hwdep(struct snd_card *card,
struct hdsp *hdsp)
{
struct snd_hwdep *hw;
@@ -4857,7 +4857,7 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp

#ifdef HDSP_FW_LOADER
/* load firmware via hotplug fw loader */
-static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp)
+static int hdsp_request_fw_loader(struct hdsp *hdsp)
{
const char *fwfile;
const struct firmware *fw;
--
1.5.4.rc3.14.g44397

2008-02-17 12:28:46

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 15/27] cpufreq: fix section mismatch warnings

Fix the following warnings:
WARNING: vmlinux.o(.text+0xfe6711): Section mismatch in reference from the function cpufreq_unregister_driver() to the variable .cpuinit.data:cpufreq_cpu_notifier
WARNING: vmlinux.o(.text+0xfe68af): Section mismatch in reference from the function cpufreq_register_driver() to the variable .cpuinit.data:cpufreq_cpu_notifier
WARNING: vmlinux.o(.exit.text+0xc4fa): Section mismatch in reference from the function cpufreq_stats_exit() to the variable .cpuinit.data:cpufreq_stat_cpu_notifier

The warnings were casued by references to unregister_hotcpu_notifier()
from normal functions or exit functions.
This is flagged by modpost as a potential error because
it does not know that for the non HOTPLUG_CPU
scenario the unregister_hotcpu_notifier() is a nop.
Silence the warning by replacing the __initdata
annotation with a __refdata annotation.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Dave Jones <[email protected]>
---
drivers/cpufreq/cpufreq.c | 2 +-
drivers/cpufreq/cpufreq_stats.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 64926aa..c45768a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1783,7 +1783,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

-static struct notifier_block __cpuinitdata cpufreq_cpu_notifier =
+static struct notifier_block __refdata cpufreq_cpu_notifier =
{
.notifier_call = cpufreq_cpu_callback,
};
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 1b8312b..070421a 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
return NOTIFY_OK;
}

-static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata =
+static struct notifier_block cpufreq_stat_cpu_notifier __refdata =
{
.notifier_call = cpufreq_stat_cpu_callback,
};
--
1.5.4.rc3.14.g44397

2008-02-17 12:29:05

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 01/27] serial: silence section mismatch warnings in 8250_pci

Fix following warnings:
WARNING: drivers/serial/built-in.o(.data+0x5b8): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_ite887x_exit()
WARNING: drivers/serial/built-in.o(.data+0x5e0): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
WARNING: drivers/serial/built-in.o(.data+0x608): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
WARNING: drivers/serial/built-in.o(.data+0x658): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
WARNING: drivers/serial/built-in.o(.data+0x680): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
WARNING: drivers/serial/built-in.o(.data+0x6a8): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:pci_plx9050_exit()
WARNING: drivers/serial/built-in.o(.data+0x6d0): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:sbs_exit()
WARNING: drivers/serial/built-in.o(.data+0x6f8): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:sbs_exit()
WARNING: drivers/serial/built-in.o(.data+0x720): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:sbs_exit()
WARNING: drivers/serial/built-in.o(.data+0x748): Section mismatch in reference from the variable pci_serial_quirks to the function .devexit.text:sbs_exit()

pci_serial_quirks contains a number of function pointers
where the referenced function is annotated __devexit.
This is OK so we annotate pci_serial_quirks with
__refdata to ignore the __devexit references

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Russell King <[email protected]>
Cc: [email protected]
---
drivers/serial/8250_pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index a8bec49..c4b77a5 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -775,7 +775,7 @@ pci_default_setup(struct serial_private *priv, struct pciserial_board *board,
* This list is ordered alphabetically by vendor then device.
* Specific entries must come before more generic entries.
*/
-static struct pci_serial_quirk pci_serial_quirks[] = {
+static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
/*
* ADDI-DATA GmbH communication cards <[email protected]>
*/
--
1.5.4.rc3.14.g44397

2008-02-17 12:29:27

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 22/27] x86: fix section mismatch in head_64.S:initial_code

Fix following warning:
WARNING: vmlinux.o(.cpuinit.data+0x0): Section mismatch in reference from the variable initial_code to the function .init.text:x86_64_start_kernel()

initial_code are initially used to hold a function pointer
from __init and later from __cpuinit. This confuses modpost
and changing initial_code to REFDATA silence the warning.
(But now we do not discard the variable anymore).

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/head_64.S | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 09b38d5..220daaa 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -250,7 +250,7 @@ ENTRY(secondary_startup_64)
lretq

/* SMP bootup changes these two */
- __CPUINITDATA
+ __REFDATA
.align 8
ENTRY(initial_code)
.quad x86_64_start_kernel
--
1.5.4.rc3.14.g44397

2008-02-17 12:29:46

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 16/27] scsi: fix section mismatch in aic94xx

Fix following warnings:
WARNING: vmlinux.o(.data+0x17aa88): Section mismatch in reference from the variable asd_pcidev_data to the function .devinit.text:asd_aic9410_setup()
WARNING: vmlinux.o(.data+0x17aa98): Section mismatch in reference from the variable asd_pcidev_data to the function .devinit.text:asd_aic9410_setup()
WARNING: vmlinux.o(.data+0x17aaa8): Section mismatch in reference from the variable asd_pcidev_data to the function .devinit.text:asd_aic9405_setup()

asd_pcidev_data is only used by __devinit asd_pci_probe.
So mark is const and annotate it __devinitconst to fix
the warnings.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Gilbert Wu <[email protected]>
Cc: James Bottomley <[email protected]>
---
drivers/scsi/aic94xx/aic94xx_init.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 5d761eb..720812f 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -531,10 +531,10 @@ static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
/* The first entry, 0, is used for dynamic ids, the rest for devices
* we know about.
*/
-static struct asd_pcidev_struct {
+static const struct asd_pcidev_struct {
const char * name;
int (*setup)(struct asd_ha_struct *asd_ha);
-} asd_pcidev_data[] = {
+} asd_pcidev_data[] __devinitconst = {
/* Id 0 is used for dynamic ids. */
{ .name = "Adaptec AIC-94xx SAS/SATA Host Adapter",
.setup = asd_aic9410_setup
--
1.5.4.rc3.14.g44397

2008-02-17 12:30:12

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 26/27] acpi: fix section mismatch in acpi_pci_root_add

Fix following warning:
WARNING: vmlinux.o(.text+0x550e85): Section mismatch in reference from the function acpi_pci_root_add() to the function .devinit.text:pci_acpi_scan_root()

acpi_pci_root_add uses a __devinit annotated function and
it looks like annotating it __devinit too is the correct fix.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Len Brown <[email protected]>
---
drivers/acpi/pci_root.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index f14ff1f..c3fed31 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -184,7 +184,7 @@ static void acpi_pci_bridge_scan(struct acpi_device *device)
}
}

-static int acpi_pci_root_add(struct acpi_device *device)
+static int __devinit acpi_pci_root_add(struct acpi_device *device)
{
int result = 0;
struct acpi_pci_root *root = NULL;
--
1.5.4.rc3.14.g44397

2008-02-17 12:30:45

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 17/27] acer-wmi: fix section mismatch warnings

Fix following warnings:
WARNING: vmlinux.o(.text+0x672615): Section mismatch in reference from the function acer_platform_remove() to the function .exit.text:acer_backlight_exit()
WARNING: vmlinux.o(.devinit.text+0x1e859): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_led_init()
WARNING: vmlinux.o(.devinit.text+0x1e878): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_backlight_init()

Remove __exit annotation from acer_backlight_exit(). We cannot reference
a __exit annotated function from non __exit functions.

acer_led_init() and acer_backlight_init() where both annotated __init but
used from a __devinit function. This would result in an oops should
gcc drop their inlining and the module are hot plugged.

Fix by annotating acer_led_init() and acer_backlight_init() __devinit.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Carlos Corbacho <[email protected]>
Cc: Len Brown <[email protected]>
---
drivers/misc/acer-wmi.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index d7aea93..cdc733b 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -756,7 +756,7 @@ static struct led_classdev mail_led = {
.brightness_set = mail_led_set,
};

-static int __init acer_led_init(struct device *dev)
+static int __devinit acer_led_init(struct device *dev)
{
return led_classdev_register(dev, &mail_led);
}
@@ -789,7 +789,7 @@ static struct backlight_ops acer_bl_ops = {
.update_status = update_bl_status,
};

-static int __init acer_backlight_init(struct device *dev)
+static int __devinit acer_backlight_init(struct device *dev)
{
struct backlight_device *bd;

@@ -808,7 +808,7 @@ static int __init acer_backlight_init(struct device *dev)
return 0;
}

-static void __exit acer_backlight_exit(void)
+static void acer_backlight_exit(void)
{
backlight_device_unregister(acer_backlight_device);
}
--
1.5.4.rc3.14.g44397

2008-02-17 12:31:00

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 10/27] x86: fix section mismatch in setup_64.c:srat_detect_node

Fix following warnings:
WARNING: vmlinux.o(.text+0x1bb40): Section mismatch in reference from the function srat_detect_node() to the variable .cpuinit.data:apicid_to_node
WARNING: vmlinux.o(.text+0x1bb70): Section mismatch in reference from the function srat_detect_node() to the function .cpuinit.text:numa_set_node()

srat_detect_node() is only used by __cpuinit init_intel().
So the trivial fix is to annotate srat_detect_node() with __cpuinit.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/kernel/setup_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index ff9029d..e186617 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -791,7 +791,7 @@ static int __cpuinit intel_num_cpu_cores(struct cpuinfo_x86 *c)
return 1;
}

-static void srat_detect_node(void)
+static void __cpuinit srat_detect_node(void)
{
#ifdef CONFIG_NUMA
unsigned node;
--
1.5.4.rc3.14.g44397

2008-02-17 12:31:28

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 20/27] [ALSA] caiaq - fix section mismatch warning

Fix following warning:
WARNING: vmlinux.o(.text+0x11ec01a): Section mismatch in reference from the function setup_card() to the function .devinit.text:snd_usb_caiaq_control_init()

setup_card() are only used by init_card().
init_card() are only used by snd_probe()
snd_probe() are used for the .probe parameter in usb_driver.probe

Annotate them all __devinit to fix the warning.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Daniel Mack <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
---
sound/usb/caiaq/caiaq-device.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c
index 58d25e4..7c44a2c 100644
--- a/sound/usb/caiaq/caiaq-device.c
+++ b/sound/usb/caiaq/caiaq-device.c
@@ -245,7 +245,7 @@ int snd_usb_caiaq_set_auto_msg (struct snd_usb_caiaqdev *dev,
tmp, sizeof(tmp));
}

-static void setup_card(struct snd_usb_caiaqdev *dev)
+static void __devinit setup_card(struct snd_usb_caiaqdev *dev)
{
int ret;
char val[4];
@@ -359,7 +359,7 @@ static struct snd_card* create_card(struct usb_device* usb_dev)
return card;
}

-static int init_card(struct snd_usb_caiaqdev *dev)
+static int __devinit init_card(struct snd_usb_caiaqdev *dev)
{
char *c;
struct usb_device *usb_dev = dev->chip.dev;
@@ -428,7 +428,7 @@ static int init_card(struct snd_usb_caiaqdev *dev)
return 0;
}

-static int snd_probe(struct usb_interface *intf,
+static int __devinit snd_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
int ret;
--
1.5.4.rc3.14.g44397

2008-02-17 12:31:47

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 05/27] cpu: fix section mismatch warnings in hotcpu_register

Fix following warnings:
WARNING: vmlinux.o(.data+0x5020): Section mismatch in reference from the variable cpu_vsyscall_notifier_nb.12876 to the function .cpuinit.text:cpu_vsyscall_notifier()
WARNING: vmlinux.o(.data+0x9ce0): Section mismatch in reference from the variable profile_cpu_callback_nb.17654 to the function .devinit.text:profile_cpu_callback()
WARNING: vmlinux.o(.data+0xd380): Section mismatch in reference from the variable workqueue_cpu_callback_nb.15004 to the function .devinit.text:workqueue_cpu_callback()
WARNING: vmlinux.o(.data+0x11d00): Section mismatch in reference from the variable relay_hotcpu_callback_nb.19626 to the function .cpuinit.text:relay_hotcpu_callback()
WARNING: vmlinux.o(.data+0x12970): Section mismatch in reference from the variable cpu_callback_nb.24694 to the function .devinit.text:cpu_callback()
WARNING: vmlinux.o(.data+0x3fee0): Section mismatch in reference from the variable percpu_counter_hotcpu_callback_nb.10903 to the function .cpuinit.text:percpu_counter_hotcpu_callback()
WARNING: vmlinux.o(.data+0x74ce0): Section mismatch in reference from the variable topology_cpu_callback_nb.12506 to the function .cpuinit.text:topology_cpu_callback()

Functions used as argument are by definition only used
in HOTPLUG_CPU situations so thay are annotated __cpuinit.
Annotate the static variable used by hotcpu_register with
__cpuinitdata to match this definition.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Gautham R Shenoy <[email protected]>
---
include/linux/cpu.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 0be8d65..237c19a 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -109,7 +109,7 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
extern void get_online_cpus(void);
extern void put_online_cpus(void);
#define hotcpu_notifier(fn, pri) { \
- static struct notifier_block fn##_nb = \
+ static struct notifier_block fn##_nb __cpuinitdata = \
{ .notifier_call = fn, .priority = pri }; \
register_cpu_notifier(&fn##_nb); \
}
--
1.5.4.rc3.14.g44397

2008-02-17 12:32:09

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 23/27] x86: annotate pci/common.s:pci_scan_bus_with_sysdata with __devinit

pci_scan_bus_with_sysdata() is only used from either __init
or __devinit functions so annotate it __devinit to match the usage.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/pci/common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index b7c67a1..7b6e3bb 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -541,7 +541,7 @@ void pcibios_disable_device (struct pci_dev *dev)
pcibios_disable_irq(dev);
}

-struct pci_bus *pci_scan_bus_with_sysdata(int busno)
+struct pci_bus *__devinit pci_scan_bus_with_sysdata(int busno)
{
struct pci_bus *bus = NULL;
struct pci_sysdata *sd;
--
1.5.4.rc3.14.g44397

2008-02-17 12:32:30

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH 25/27] pci: fix section mismatch warning in pci_scan_child_bus

Fix following warning:
WARNING: vmlinux.o(.text+0x47bdb1): Section mismatch in reference from the function pci_scan_child_bus() to the function .devinit.text:pcibios_fixup_bus()

We had plenty of functions that could be annotated __devinit but
due to the former restriction that annotated symbols could not
be annotated they were not so.
So annotate these function and fix the references from the
pci/hotplug/* code to silence the resuting warnings.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Greg KH <[email protected]>
---
drivers/pci/hotplug-pci.c | 2 +-
drivers/pci/hotplug/acpiphp_glue.c | 2 +-
drivers/pci/hotplug/cpci_hotplug_pci.c | 2 +-
drivers/pci/hotplug/pciehp_pci.c | 2 +-
drivers/pci/hotplug/shpchp_pci.c | 2 +-
drivers/pci/probe.c | 8 ++++----
6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c
index a590ef6..4d4a644 100644
--- a/drivers/pci/hotplug-pci.c
+++ b/drivers/pci/hotplug-pci.c
@@ -4,7 +4,7 @@
#include "pci.h"


-unsigned int pci_do_scan_bus(struct pci_bus *bus)
+unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
{
unsigned int max;

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cf22f9e..5e50008 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -1085,7 +1085,7 @@ static int acpiphp_bus_trim(acpi_handle handle)
* This function should be called per *physical slot*,
* not per each slot object in ACPI namespace.
*/
-static int enable_device(struct acpiphp_slot *slot)
+static int __ref enable_device(struct acpiphp_slot *slot)
{
struct pci_dev *dev;
struct pci_bus *bus = slot->bridge->pci_bus;
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 5e9be44..dddac96 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -250,7 +250,7 @@ int cpci_led_off(struct slot* slot)
* Device configuration functions
*/

-int cpci_configure_slot(struct slot* slot)
+int __ref cpci_configure_slot(struct slot* slot)
{
struct pci_bus *parent;
int fn;
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index dd50713..9372a84 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -167,7 +167,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
}
}

-static int pciehp_add_bridge(struct pci_dev *dev)
+static int __ref pciehp_add_bridge(struct pci_dev *dev)
{
struct pci_bus *parent = dev->bus;
int pass, busnr, start = parent->secondary;
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 0a6b25e..a69a215 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -96,7 +96,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
}
}

-int shpchp_configure_device(struct slot *p_slot)
+int __ref shpchp_configure_device(struct slot *p_slot)
{
struct pci_dev *dev;
struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4d23b9f..5ffd610 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -286,7 +286,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
}
}

-void pci_read_bridge_bases(struct pci_bus *child)
+void __devinit pci_read_bridge_bases(struct pci_bus *child)
{
struct pci_dev *dev = child->self;
u8 io_base_lo, io_limit_lo;
@@ -472,7 +472,7 @@ static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
* them, we proceed to assigning numbers to the remaining buses in
* order to avoid overlaps between old and new bus numbers.
*/
-int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass)
+int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass)
{
struct pci_bus *child;
int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
@@ -1008,7 +1008,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
return nr;
}

-unsigned int pci_scan_child_bus(struct pci_bus *bus)
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
{
unsigned int devfn, pass, max = bus->secondary;
struct pci_dev *dev;
@@ -1116,7 +1116,7 @@ err_out:
return NULL;
}

-struct pci_bus *pci_scan_bus_parented(struct device *parent,
+struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
int bus, struct pci_ops *ops, void *sysdata)
{
struct pci_bus *b;
--
1.5.4.rc3.14.g44397

2008-02-17 13:04:20

by Carlos Corbacho

[permalink] [raw]
Subject: Re: [PATCH 17/27] acer-wmi: fix section mismatch warnings

On Sunday 17 February 2008 12:22:54 Sam Ravnborg wrote:
> Fix following warnings:
> WARNING: vmlinux.o(.text+0x672615): Section mismatch in reference from the
> function acer_platform_remove() to the function
> .exit.text:acer_backlight_exit() WARNING: vmlinux.o(.devinit.text+0x1e859):
> Section mismatch in reference from the function acer_platform_probe() to
> the function .init.text:acer_led_init() WARNING:
> vmlinux.o(.devinit.text+0x1e878): Section mismatch in reference from the
> function acer_platform_probe() to the function
> .init.text:acer_backlight_init()
>
> Remove __exit annotation from acer_backlight_exit(). We cannot reference
> a __exit annotated function from non __exit functions.
>
> acer_led_init() and acer_backlight_init() where both annotated __init but
> used from a __devinit function. This would result in an oops should
> gcc drop their inlining and the module are hot plugged.
>
> Fix by annotating acer_led_init() and acer_backlight_init() __devinit.
>
> Signed-off-by: Sam Ravnborg <[email protected]>

Signed-off-by: Carlos Corbacho <[email protected]>

> Cc: Len Brown <[email protected]>

Len, can you apply this to acpi-test? (Unless Andrew wants to take all these
through -mm?)

-Carlos
--
E-Mail: [email protected]
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D

2008-02-17 13:44:49

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 09/27] x86: fix section mismatch warning in setup_64.c:nearby_node

on Sun, 17 Feb 2008, Sam Ravnborg wrote:

> Fix following warnings:
> WARNING: vmlinux.o(.text+0x1baa2): Section mismatch in reference from the function nearby_node() to the variable .cpuinit.data:apicid_to_node
> WARNING: vmlinux.o(.text+0x1bace): Section mismatch in reference from the function nearby_node() to the variable .cpuinit.data:apicid_to_node
>
> nearby_node() were only used by __cpuinit amd_detect_cmp()
> So annotating nearby_node() __cpuinit was the trivial fix.

Applied the x86 ones.

Thanks,

tglx

2008-02-17 15:05:46

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 09/27] x86: fix section mismatch warning in setup_64.c:nearby_node

On Sun, Feb 17, 2008 at 02:44:23PM +0100, Thomas Gleixner wrote:
> on Sun, 17 Feb 2008, Sam Ravnborg wrote:
>
> > Fix following warnings:
> > WARNING: vmlinux.o(.text+0x1baa2): Section mismatch in reference from the function nearby_node() to the variable .cpuinit.data:apicid_to_node
> > WARNING: vmlinux.o(.text+0x1bace): Section mismatch in reference from the function nearby_node() to the variable .cpuinit.data:apicid_to_node
> >
> > nearby_node() were only used by __cpuinit amd_detect_cmp()
> > So annotating nearby_node() __cpuinit was the trivial fix.
>
> Applied the x86 ones.

Thanks Thomas.

Sam

2008-02-17 15:06:05

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 17/27] acer-wmi: fix section mismatch warnings

On Sun, Feb 17, 2008 at 01:03:55PM +0000, Carlos Corbacho wrote:
> On Sunday 17 February 2008 12:22:54 Sam Ravnborg wrote:
> > Fix following warnings:
> > WARNING: vmlinux.o(.text+0x672615): Section mismatch in reference from the
> > function acer_platform_remove() to the function
> > .exit.text:acer_backlight_exit() WARNING: vmlinux.o(.devinit.text+0x1e859):
> > Section mismatch in reference from the function acer_platform_probe() to
> > the function .init.text:acer_led_init() WARNING:
> > vmlinux.o(.devinit.text+0x1e878): Section mismatch in reference from the
> > function acer_platform_probe() to the function
> > .init.text:acer_backlight_init()
> >
> > Remove __exit annotation from acer_backlight_exit(). We cannot reference
> > a __exit annotated function from non __exit functions.
> >
> > acer_led_init() and acer_backlight_init() where both annotated __init but
> > used from a __devinit function. This would result in an oops should
> > gcc drop their inlining and the module are hot plugged.
> >
> > Fix by annotating acer_led_init() and acer_backlight_init() __devinit.
> >
> > Signed-off-by: Sam Ravnborg <[email protected]>
>
> Signed-off-by: Carlos Corbacho <[email protected]>
>
> > Cc: Len Brown <[email protected]>
>
> Len, can you apply this to acpi-test? (Unless Andrew wants to take all these
> through -mm?)

Thanks for the quick reply Carlos.

Sam

2008-02-17 17:11:58

by Mark M. Hoffman

[permalink] [raw]
Subject: Re: [PATCH 14/27] hwmon: fix section mismatch in coretemp

Hi Sam:

* Sam Ravnborg <[email protected]> [2008-02-17 13:22:51 +0100]:
> Fix following warning:
> WARNING: vmlinux.o(.text+0xebfd04): Section mismatch in reference from the function coretemp_cpu_callback() to the function .cpuinit.text:coretemp_device_add()
>
> coretemp_cpu_callback() are only used inside a
> HOTPLUG_CPU block so annotate it __cpuinit.
> The notifier referencing the function are annotated
> __refdata to silence warning from the exit function.
> The unregister function do not use the embedded pointer
> but clears the variable so the annotation is OK.
>
> Signed-off-by: Sam Ravnborg <[email protected]>
> Cc: Mark M. Hoffman <[email protected]>
> ---
> drivers/hwmon/coretemp.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
> index 3ee60d2..1439432 100644
> --- a/drivers/hwmon/coretemp.c
> +++ b/drivers/hwmon/coretemp.c
> @@ -330,7 +330,7 @@ static void coretemp_device_remove(unsigned int cpu)
> mutex_unlock(&pdev_list_mutex);
> }
>
> -static int coretemp_cpu_callback(struct notifier_block *nfb,
> +static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
> unsigned long action, void *hcpu)
> {
> unsigned int cpu = (unsigned long) hcpu;
> @@ -347,7 +347,7 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
> return NOTIFY_OK;
> }
>
> -static struct notifier_block coretemp_cpu_notifier = {
> +static struct notifier_block coretemp_cpu_notifier __refdata = {
> .notifier_call = coretemp_cpu_callback,
> };
> #endif /* !CONFIG_HOTPLUG_CPU */
> --
> 1.5.4.rc3.14.g44397

This rings a bell... hmmm, commit 59a35bafb223bbb0553ba1a3bb9280bda668a8d8.
AFAICT the warning is a false positive, but whatever.

Applied to hwmon-2.6.git/testing, thanks.

--
Mark M. Hoffman
[email protected]

2008-02-17 17:20:19

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 14/27] hwmon: fix section mismatch in coretemp

>
> This rings a bell... hmmm, commit 59a35bafb223bbb0553ba1a3bb9280bda668a8d8.
> AFAICT the warning is a false positive, but whatever.

Yes it is - the __refdata is there only to silence modpost.

>
> Applied to hwmon-2.6.git/testing, thanks.

Thanks,

Sam

2008-02-18 06:43:43

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 27/27] [ALSA] hdsp - fix section mismatch warnings

At Sun, 17 Feb 2008 13:23:04 +0100,
Sam Ravnborg wrote:
>
> Fix following warnings:
> WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x34bc): Section mismatch in reference from the function hdsp_check_for_firmware() to the function .devinit.text:hdsp_request_fw_loader()
> WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x4ac6): Section mismatch in reference from the function snd_hdsp_proc_read() to the function .devinit.text:hdsp_request_fw_loader()
>
> Calling hdsp_request_fw_loader() were triggered from /proc
> so this is not restricted to init or hotplug.
> So removing the __devexit annotation of this function
> and one of the functions fix the warning.

Thanks. The exactly same fix has been already on ALSA tree since
weeks ago, but was never pushed...


Takashi

>
> Signed-off-by: Sam Ravnborg <[email protected]>
> Cc: Takashi Iwai <[email protected]>
> Cc: Jaroslav Kysela <[email protected]>
> ---
> sound/pci/rme9652/hdsp.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
> index c2bd438..6f07a25 100644
> --- a/sound/pci/rme9652/hdsp.c
> +++ b/sound/pci/rme9652/hdsp.c
> @@ -745,7 +745,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
>
>
> #ifdef HDSP_FW_LOADER
> -static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp);
> +static int hdsp_request_fw_loader(struct hdsp *hdsp);
> #endif
>
> static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
> @@ -4688,7 +4688,7 @@ static struct snd_pcm_ops snd_hdsp_capture_ops = {
> .copy = snd_hdsp_capture_copy,
> };
>
> -static int __devinit snd_hdsp_create_hwdep(struct snd_card *card,
> +static int snd_hdsp_create_hwdep(struct snd_card *card,
> struct hdsp *hdsp)
> {
> struct snd_hwdep *hw;
> @@ -4857,7 +4857,7 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp
>
> #ifdef HDSP_FW_LOADER
> /* load firmware via hotplug fw loader */
> -static int __devinit hdsp_request_fw_loader(struct hdsp *hdsp)
> +static int hdsp_request_fw_loader(struct hdsp *hdsp)
> {
> const char *fwfile;
> const struct firmware *fw;
> --
> 1.5.4.rc3.14.g44397
>

2008-02-18 07:45:13

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 27/27] [ALSA] hdsp - fix section mismatch warnings

On Mon, Feb 18, 2008 at 07:43:32AM +0100, Takashi Iwai wrote:
> At Sun, 17 Feb 2008 13:23:04 +0100,
> Sam Ravnborg wrote:
> >
> > Fix following warnings:
> > WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x34bc): Section mismatch in reference from the function hdsp_check_for_firmware() to the function .devinit.text:hdsp_request_fw_loader()
> > WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x4ac6): Section mismatch in reference from the function snd_hdsp_proc_read() to the function .devinit.text:hdsp_request_fw_loader()
> >
> > Calling hdsp_request_fw_loader() were triggered from /proc
> > so this is not restricted to init or hotplug.
> > So removing the __devexit annotation of this function
> > and one of the functions fix the warning.
>
> Thanks. The exactly same fix has been already on ALSA tree since
> weeks ago, but was never pushed...

OK, I assume this will be pushed soonish so we can kill
another warning.

Sam

2008-02-18 10:35:56

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 20/27] [ALSA] caiaq - fix section mismatch warning

At Sun, 17 Feb 2008 13:22:57 +0100,
Sam Ravnborg wrote:
>
> Fix following warning:
> WARNING: vmlinux.o(.text+0x11ec01a): Section mismatch in reference from the function setup_card() to the function .devinit.text:snd_usb_caiaq_control_init()
>
> setup_card() are only used by init_card().
> init_card() are only used by snd_probe()
> snd_probe() are used for the .probe parameter in usb_driver.probe
>
> Annotate them all __devinit to fix the warning.
>
> Signed-off-by: Sam Ravnborg <[email protected]>
> Cc: Daniel Mack <[email protected]>
> Cc: Takashi Iwai <[email protected]>
> Cc: Jaroslav Kysela <[email protected]>

Thanks, applied to ALSA tree now. I did another fix for this section
mismatch, but reverted it now since yours is better :)


Takashi

2008-02-18 10:36:36

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 27/27] [ALSA] hdsp - fix section mismatch warnings

At Mon, 18 Feb 2008 08:45:08 +0100,
Sam Ravnborg wrote:
>
> On Mon, Feb 18, 2008 at 07:43:32AM +0100, Takashi Iwai wrote:
> > At Sun, 17 Feb 2008 13:23:04 +0100,
> > Sam Ravnborg wrote:
> > >
> > > Fix following warnings:
> > > WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x34bc): Section mismatch in reference from the function hdsp_check_for_firmware() to the function .devinit.text:hdsp_request_fw_loader()
> > > WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x4ac6): Section mismatch in reference from the function snd_hdsp_proc_read() to the function .devinit.text:hdsp_request_fw_loader()
> > >
> > > Calling hdsp_request_fw_loader() were triggered from /proc
> > > so this is not restricted to init or hotplug.
> > > So removing the __devexit annotation of this function
> > > and one of the functions fix the warning.
> >
> > Thanks. The exactly same fix has been already on ALSA tree since
> > weeks ago, but was never pushed...
>
> OK, I assume this will be pushed soonish so we can kill
> another warning.

I sincerly hope it'll be pushed soonish...


Takashi