ALSA: more section mismatches
PATCH 1/1 ALSA: more section mismatches
From: Randy Dunlap <[email protected]>
Fix section mismatch warnings:
WARNING: sound/built-in.o(.exit.text+0x3ad): Section mismatch: reference to .init.text: (between 'sb_exit' and 'unload_uart6850')
WARNING: sound/built-in.o(.exit.text+0x753): Section mismatch: reference to .init.text: (between 'snd_mts64_module_exit' and 'snd_portman_module_exit')
--- sound/drivers/mts64.c | 2 +- sound/oss/sb_card.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/drivers/mts64.c +1 -1
@@ -1048,7 +1048,7 @@ static struct platform_driver snd_mts64_/********************************************************************* * module init stuff *********************************************************************/ -static void __init_or_module snd_mts64_unregister_all(void) +static void snd_mts64_unregister_all (void ) {int i;
sound/oss/sb_card.c +1 -1
@@ -290,7 +290,7 @@ static struct pnp_card_driver sb_pnp_driMODULE_DEVICE_TABLE (pnp_card, sb_pnp_card_table);#endif /* CONFIG_PNP */ -static void __init_or_module sb_unregister_all(void) +static void sb_unregister_all (void ) {#ifdef CONFIG_PNP if (pnp_registered)
Quoted 16 lines · On Thu, 28 Jun 2007 15:05:15 -0700 Randy Dunlap <[email protected]> wrote:
From: Randy Dunlap <[email protected]>
Fix section mismatch warnings:
WARNING: sound/built-in.o(.exit.text+0x3ad): Section mismatch: reference to .init.text: (between '
sb_exit' and 'unload_uart6850')
WARNING: sound/built-in.o(.exit.text+0x753): Section mismatch: reference to .init.text: (between 'snd_mts64_module_exit' and 'snd_portman_module_exit')Signed-off-by Randy Dunlap <[email protected]>--- sound/drivers/mts64.c | 2 +- sound/oss/sb_card.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/drivers/mts64.c static struct platform_driver snd_mts64_ · line 1051
Quoted 5 lines
sound/drivers/mts64.c +1
-1@@ -1048,7 +1048,7 @@ static struct platform_driver snd_mts64_/********************************************************************* * module init stuff *********************************************************************/ -static void __init_or_module snd_mts64_unregister_all(void) +static void snd_mts64_unregister_all (void )
Well this is called from __exit, so __init_or_module isn't right. But we don't have an __exit_or_module.
Quoted 6 lines
sound/drivers/mts64.c +0
-0{int i;
sound/oss/sb_card.c static struct pnp_card_driver sb_pnp_dri · line 296
Quoted 8 lines
sound/oss/sb_card.c +1
-1@@ -290,7 +290,7 @@ static struct pnp_card_driver sb_pnp_driMODULE_DEVICE_TABLE (pnp_card, sb_pnp_card_table);#endif /* CONFIG_PNP */ -static void __init_or_module sb_unregister_all(void) +static void sb_unregister_all (void ) {#ifdef CONFIG_PNP if (pnp_registered)
One of these is alsa and the other isn't.
But what the heck: obviously safe, I'll slam it all in.
Quoted 16 lines · Andrew Morton
Quoted 13 lines · On Thu, 28 Jun 2007 15:05:15 -0700 Randy Dunlap <[email protected]> wrote:
From: Randy Dunlap <[email protected]>
Fix section mismatch warnings:
WARNING: sound/built-in.o(.exit.text+0x3ad): Section mismatch: reference to .init.text: (between '
sb_exit' and 'unload_uart6850')
WARNING: sound/built-in.o(.exit.text+0x753): Section mismatch: reference to .init.text: (between 'snd_mts64_module_exit' and 'snd_portman_module_exit')Signed-off-by Randy Dunlap <[email protected]>--- sound/drivers/mts64.c | 2 +- sound/oss/sb_card.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 12 lines
sound/drivers/mts64.c static struct platform_driver snd_mts64_ · line 1051
Quoted 8 lines
sound/drivers/mts64.c +1
-1@@ -1048,7 +1048,7 @@ static struct platform_driver snd_mts64_/********************************************************************* * module init stuff *********************************************************************/ -static void __init_or_module snd_mts64_unregister_all(void) +static void snd_mts64_unregister_all (void )Well this is called from
__exit, so__init_or_moduleisn't right. But we don't have an__exit_or_module.
...
No, it's correct. It simply says that this code can only be discarted after initialization if it's not a module, since it's also used from __exit code.
The idea behind __init_or_module is that __exit code is never executed for non-modular code, and such cases where some function is executed both by both __init and __exit and never from other code aren't that unusual.
I'm not sure how realistic it is, but it would be best if we could at some point in the future simply give gcc a few basic hints that stuff like module_init() can use code that is __init and let gcc figure out which code to move to this section...
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedAt Thu, 28 Jun 2007 15:39:49 -0700,
Quoted 17 lines · Andrew Morton
Quoted 13 lines · On Thu, 28 Jun 2007 15:05:15 -0700 Randy Dunlap <[email protected]> wrote:
From: Randy Dunlap <[email protected]>
Fix section mismatch warnings:
WARNING: sound/built-in.o(.exit.text+0x3ad): Section mismatch: reference to .init.text: (between '
sb_exit' and 'unload_uart6850')
WARNING: sound/built-in.o(.exit.text+0x753): Section mismatch: reference to .init.text: (between 'snd_mts64_module_exit' and 'snd_portman_module_exit')Signed-off-by Randy Dunlap <[email protected]>--- sound/drivers/mts64.c | 2 +- sound/oss/sb_card.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 11 lines
sound/drivers/mts64.c static struct platform_driver snd_mts64_ · line 1051
Quoted 8 lines
sound/drivers/mts64.c +1
-1@@ -1048,7 +1048,7 @@ static struct platform_driver snd_mts64_/********************************************************************* * module init stuff *********************************************************************/ -static void __init_or_module snd_mts64_unregister_all(void) +static void snd_mts64_unregister_all (void )Well this is called from
__exit, so__init_or_moduleisn't right. But we don't have an__exit_or_module.
Well, the name is a bit confusing. As Adrian pointed, it's called _only_ from init or module.
Quoted 18 lines
Quoted 7 lines
sound/drivers/mts64.c +0
-0{int i;sound/oss/sb_card.c static struct pnp_card_driver sb_pnp_dri · line 296
Quoted 8 lines
sound/oss/sb_card.c +1
-1@@ -290,7 +290,7 @@ static struct pnp_card_driver sb_pnp_driMODULE_DEVICE_TABLE (pnp_card, sb_pnp_card_table);#endif /* CONFIG_PNP */ -static void __init_or_module sb_unregister_all(void) +static void sb_unregister_all (void ) {#ifdef CONFIG_PNP if (pnp_registered)One of these is alsa and the other isn't.
Quoted 1 line
But what the heck: obviously safe, I'll slam it all in.
Yes, I'll merge them to ALSA tree, too.
A few bytes of diet won't be a big win in comparison with annoyance by
compiler warnings. ... Or, fix the tool!
Takashi