Skip to contentSkip to conversation

Some fixes for "Section mismatch" errors.

PATCH Peter Teoh 2 participants 2 messages Feb 2, 2008

lore
Share & tools
lore

Peter Teoh

author
#0 lore raw

Today, I pulled from linus tree, and compile with MANY section mismatches errors, eg, some of which are like the following:

WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x1c9f): 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+0x35bf): Section mismatch in reference from the function snd_hdsp_proc_read() to the function .devinit.text:hdsp_request_fw_loader()

I have attempted the fixes as shown in the attachment - I may be doing a disservice to the many hours of hardwork put in by everyone - I
apologized for that :-(. Please comment - I am just correcting it
syntactically to overcome all the section mismatches errors I am
encountering. But logic-wise it may be wrong.

Thanks.

x86/kernel/cpuid.c renamed from x86/kernel/cpuid.c.orig +4 -4
@@ -134,7 +134,7 @@ static const struct file_operations cpui
 	.open = cpuid_open,
 };
 
-static __cpuinit int cpuid_device_create(int cpu)
+static int cpuid_device_create(int cpu)
 {
 	struct device *dev;
 
@@ -148,7 +148,7 @@ static void cpuid_device_destroy(int cpu
 	device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
 }
 
-static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb,
+static int cpuid_class_cpu_callback(struct notifier_block *nfb,
 					      unsigned long action,
 					      void *hcpu)
 {
@@ -170,12 +170,12 @@ static int __cpuinit cpuid_class_cpu_cal
 	return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
-static struct notifier_block __refdata cpuid_class_cpu_notifier =
+static struct notifier_block cpuid_class_cpu_notifier =
 {
 	.notifier_call = cpuid_class_cpu_callback,
 };
 
-static int __init cpuid_init(void)
+static int __cpuinit cpuid_init(void)
 {
 	int i, err = 0;
 	i = 0;
x86/kernel/microcode.c renamed from x86/kernel/microcode.c.orig +2 -2
@@ -797,7 +797,7 @@ mc_cpu_callback(struct notifier_block *n
 	return NOTIFY_OK;
 }
 
-static struct notifier_block __refdata mc_cpu_notifier = {
+static struct notifier_block mc_cpu_notifier __initdata = {
 	.notifier_call = mc_cpu_callback,
 };
 
@@ -831,7 +831,7 @@ static int __init microcode_init (void)
 	return 0;
 }
 
-static void __exit microcode_exit (void)
+static void __init microcode_exit (void)
 {
 	microcode_dev_exit();
 
x86/kernel/msr.c renamed from x86/kernel/msr.c.orig +3 -3
@@ -133,7 +133,7 @@ static const struct file_operations msr_
 	.open = msr_open,
 };
 
-static int __cpuinit msr_device_create(int cpu)
+static int msr_device_create(int cpu)
 {
 	struct device *dev;
 
@@ -147,7 +147,7 @@ static void msr_device_destroy(int cpu)
 	device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
 }
 
-static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
+static int msr_class_cpu_callback(struct notifier_block *nfb,
 				unsigned long action, void *hcpu)
 {
 	unsigned int cpu = (unsigned long)hcpu;
@@ -168,7 +168,7 @@ static int __cpuinit msr_class_cpu_callb
 	return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
-static struct notifier_block __refdata msr_class_cpu_notifier = {
+static struct notifier_block msr_class_cpu_notifier = {
 	.notifier_call = msr_class_cpu_callback,
 };
 
ata/ata_piix.c renamed from ata/ata_piix.c.orig +4 -4
@@ -1431,7 +1431,7 @@ static int piix_disable_ahci(struct pci_
  *	they are found return an error code so we can turn off DMA
  */
 
-static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev)
+static int piix_check_450nx_errata(struct pci_dev *ata_dev)
 {
 	struct pci_dev *pdev = NULL;
 	u16 cfg;
@@ -1455,7 +1455,7 @@ static int __devinit piix_check_450nx_er
 	return no_piix_dma;
 }
 
-static void __devinit piix_init_pcs(struct ata_host *host,
+static void piix_init_pcs(struct ata_host *host,
 				    const struct piix_map_db *map_db)
 {
 	struct pci_dev *pdev = to_pci_dev(host->dev);
@@ -1472,7 +1472,7 @@ static void __devinit piix_init_pcs(stru
 	}
 }
 
-static const int *__devinit piix_init_sata_map(struct pci_dev *pdev,
+static const int *piix_init_sata_map(struct pci_dev *pdev,
 					       struct ata_port_info *pinfo,
 					       const struct piix_map_db *map_db)
 {
@@ -1519,7 +1519,7 @@ static const int *__devinit piix_init_sa
 	return map;
 }
 
-static void __devinit piix_init_sidpr(struct ata_host *host)
+static void piix_init_sidpr(struct ata_host *host)
 {
 	struct pci_dev *pdev = to_pci_dev(host->dev);
 	struct piix_host_priv *hpriv = host->private_data;
char/tpm/tpm_infineon.c renamed from char/tpm/tpm_infineon.c.orig +2 -2
@@ -415,7 +415,7 @@ static const struct pnp_device_id tpm_pn
 
 MODULE_DEVICE_TABLE(pnp, tpm_pnp_tbl);
 
-static int __devinit tpm_inf_pnp_probe(struct pnp_dev *dev,
+static int tpm_inf_pnp_probe(struct pnp_dev *dev,
 				       const struct pnp_device_id *dev_id)
 {
 	int rc = 0;
@@ -594,7 +594,7 @@ err_last:
 	return rc;
 }
 
-static __devexit void tpm_inf_pnp_remove(struct pnp_dev *dev)
+static void tpm_inf_pnp_remove(struct pnp_dev *dev)
 {
 	struct tpm_chip *chip = pnp_get_drvdata(dev);
 
char/tpm/tpm_nsc.c renamed from char/tpm/tpm_nsc.c.orig +1 -1
@@ -264,7 +264,7 @@ static const struct tpm_vendor_specific 
 
 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 ) {
cpufreq/cpufreq_stats.c renamed from cpufreq/cpufreq_stats.c.orig +2 -2
@@ -304,7 +304,7 @@ cpufreq_stat_notifier_trans (struct noti
 	return 0;
 }
 
-static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
+static int cpufreq_stat_cpu_callback(struct notifier_block *nfb,
 					       unsigned long action,
 					       void *hcpu)
 {
@@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_ca
 	return NOTIFY_OK;
 }
 
-static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata =
+static struct notifier_block cpufreq_stat_cpu_notifier =
 {
 	.notifier_call = cpufreq_stat_cpu_callback,
 };
hwmon/coretemp.c renamed from hwmon/coretemp.c.orig +1 -1
@@ -273,7 +273,7 @@ struct pdev_entry {
 static LIST_HEAD(pdev_list);
 static DEFINE_MUTEX(pdev_list_mutex);
 
-static int __cpuinit coretemp_device_add(unsigned int cpu)
+static int coretemp_device_add(unsigned int cpu)
 {
 	int err;
 	struct platform_device *pdev;
isdn/hisax/amd7930_fn.c renamed from isdn/hisax/amd7930_fn.c.orig +1 -1
@@ -744,7 +744,7 @@ dbusy_timer_handler(struct IsdnCardState
 
 
 
-void __devinit
+void 
 Amd7930_init(struct IsdnCardState *cs)
 {
     WORD *ptr;
pcmcia/i82092.c renamed from pcmcia/i82092.c.orig +2 -2
@@ -93,7 +93,7 @@ static struct socket_info sockets[MAX_SO
 static int socket_count;  /* shortcut */                                  	                                	
 
 
-static int __devinit i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int i82092aa_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
 	unsigned char configbyte;
 	int i, ret;
@@ -187,7 +187,7 @@ err_out_disable:
 	return ret;			
 }
 
-static void __devexit i82092aa_pci_remove(struct pci_dev *dev)
+static void i82092aa_pci_remove(struct pci_dev *dev)
 {
 	struct pcmcia_socket *socket = pci_get_drvdata(dev);
 
pcmcia/pd6729.c renamed from pcmcia/pd6729.c.orig +3 -3
@@ -589,7 +589,7 @@ static int pd6729_check_irq(int irq)
 	return 0;
 }
 
-static u_int __devinit pd6729_isa_scan(void)
+static u_int pd6729_isa_scan(void)
 {
 	u_int mask0, mask = 0;
 	int i;
@@ -625,7 +625,7 @@ static u_int __devinit pd6729_isa_scan(v
 	return mask;
 }
 
-static int __devinit pd6729_pci_probe(struct pci_dev *dev,
+static int pd6729_pci_probe(struct pci_dev *dev,
 				      const struct pci_device_id *id)
 {
 	int i, j, ret;
@@ -732,7 +732,7 @@ static int __devinit pd6729_pci_probe(st
 	return ret;
 }
 
-static void __devexit pd6729_pci_remove(struct pci_dev *dev)
+static void pd6729_pci_remove(struct pci_dev *dev)
 {
 	int i;
 	struct pd6729_socket *socket = pci_get_drvdata(dev);
scsi/aic94xx/aic94xx_init.c renamed from scsi/aic94xx/aic94xx_init.c.orig +3 -3
@@ -224,7 +224,7 @@ static const char *asd_dev_rev[30] = {
 	[8] = "B0",
 };
 
-static int __devinit asd_common_setup(struct asd_ha_struct *asd_ha)
+static int asd_common_setup(struct asd_ha_struct *asd_ha)
 {
 	int err, i;
 
@@ -260,7 +260,7 @@ Err:
 	return err;
 }
 
-static int __devinit asd_aic9410_setup(struct asd_ha_struct *asd_ha)
+static int asd_aic9410_setup(struct asd_ha_struct *asd_ha)
 {
 	int err = asd_common_setup(asd_ha);
 
@@ -275,7 +275,7 @@ static int __devinit asd_aic9410_setup(s
 	return 0;
 }
 
-static int __devinit asd_aic9405_setup(struct asd_ha_struct *asd_ha)
+static int asd_aic9405_setup(struct asd_ha_struct *asd_ha)
 {
 	int err = asd_common_setup(asd_ha);
 
pci/rme9652/hdsp.c renamed from pci/rme9652/hdsp.c.orig +3 -3
@@ -745,7 +745,7 @@ static int hdsp_get_iobox_version (struc
 
 
 #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_captu
 	.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(
 
 #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 lore raw
Quoted 9 lines · Peter Teoh

Today, I pulled from linus tree, and compile with MANY section mismatches errors, eg, some of which are like the following:

WARNING: sound/pci/rme9652/snd-hdsp.o(.text+0x1c9f): 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+0x35bf): Section mismatch in reference from the function snd_hdsp_proc_read() to the function .devinit.text:hdsp_request_fw_loader()

Your fix for this particular warning looks OK. But always do:
-> One fix per patch
-> Include the warning in the patch descript that you fix -> Explain why you fixed it the way you did it

Without this info it is too time consuming to try to review your patch and I did nt look at the other changes you included.

Sam