linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: more section mismatches
@ 2007-06-23 21:58 Randy Dunlap
  0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2007-06-23 21:58 UTC (permalink / raw)
  To: perex, akpm; +Cc: lkml

From: Randy Dunlap <randy.dunlap@oracle.com>

Something about __init_or_module isn't working as expected (?).
CONFIG_HOTPLUG=y
CONFIG_MODULES=n

Fix shared init/exit code helper:
WARNING: sound/built-in.o(.exit.text+0x243): Section mismatch: reference to .init.text: (between 'alsa_card_mpu401_exit' and 'ac97_bus_exit')
WARNING: sound/built-in.o(.exit.text+0x21b): Section mismatch: reference to .init.text: (between 'alsa_card_dummy_exit' and 'alsa_card_serial_exit')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 sound/drivers/dummy.c         |    2 +-
 sound/drivers/mpu401/mpu401.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.22-rc5-git8.orig/sound/drivers/mpu401/mpu401.c
+++ linux-2.6.22-rc5-git8/sound/drivers/mpu401/mpu401.c
@@ -228,7 +228,7 @@ static struct pnp_driver snd_mpu401_pnp_
 static struct pnp_driver snd_mpu401_pnp_driver;
 #endif
 
-static void __init_or_module snd_mpu401_unregister_all(void)
+static void snd_mpu401_unregister_all(void)
 {
 	int i;
 
--- linux-2.6.22-rc5-git8.orig/sound/drivers/dummy.c
+++ linux-2.6.22-rc5-git8/sound/drivers/dummy.c
@@ -659,7 +659,7 @@ static struct platform_driver snd_dummy_
 	},
 };
 
-static void __init_or_module snd_dummy_unregister_all(void)
+static void snd_dummy_unregister_all(void)
 {
 	int i;
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ALSA: more section mismatches
  2007-06-28 22:39 ` Andrew Morton
  2007-06-28 23:49   ` Adrian Bunk
@ 2007-06-29 17:26   ` Takashi Iwai
  1 sibling, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2007-06-29 17:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Randy Dunlap, lkml, perex

At Thu, 28 Jun 2007 15:39:49 -0700,
Andrew Morton wrote:
> 
> On Thu, 28 Jun 2007 15:05:15 -0700
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> > 
> > 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 <randy.dunlap@oracle.com>
> > ---
> >  sound/drivers/mts64.c |    2 +-
> >  sound/oss/sb_card.c   |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > --- linux-2622-rc6.orig/sound/drivers/mts64.c
> > +++ linux-2622-rc6/sound/drivers/mts64.c
> > @@ -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.

Well, the name is a bit confusing.  As Adrian pointed, it's called
_only_ from init or module.

> 
> >  {
> >  	int i;
> >  
> > --- linux-2622-rc6.orig/sound/oss/sb_card.c
> > +++ linux-2622-rc6/sound/oss/sb_card.c
> > @@ -290,7 +290,7 @@ static struct pnp_card_driver sb_pnp_dri
> >  MODULE_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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ALSA: more section mismatches
  2007-06-28 22:39 ` Andrew Morton
@ 2007-06-28 23:49   ` Adrian Bunk
  2007-06-29 17:26   ` Takashi Iwai
  1 sibling, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2007-06-28 23:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Randy Dunlap, lkml, perex

On Thu, Jun 28, 2007 at 03:39:49PM -0700, Andrew Morton wrote:
> On Thu, 28 Jun 2007 15:05:15 -0700
> Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> > 
> > 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 <randy.dunlap@oracle.com>
> > ---
> >  sound/drivers/mts64.c |    2 +-
> >  sound/oss/sb_card.c   |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > --- linux-2622-rc6.orig/sound/drivers/mts64.c
> > +++ linux-2622-rc6/sound/drivers/mts64.c
> > @@ -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.
>...

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

-- 

       "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 Seed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ALSA: more section mismatches
  2007-06-28 22:05 Randy Dunlap
@ 2007-06-28 22:39 ` Andrew Morton
  2007-06-28 23:49   ` Adrian Bunk
  2007-06-29 17:26   ` Takashi Iwai
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2007-06-28 22:39 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, perex

On Thu, 28 Jun 2007 15:05:15 -0700
Randy Dunlap <randy.dunlap@oracle.com> wrote:

> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> 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 <randy.dunlap@oracle.com>
> ---
>  sound/drivers/mts64.c |    2 +-
>  sound/oss/sb_card.c   |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> --- linux-2622-rc6.orig/sound/drivers/mts64.c
> +++ linux-2622-rc6/sound/drivers/mts64.c
> @@ -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.

>  {
>  	int i;
>  
> --- linux-2622-rc6.orig/sound/oss/sb_card.c
> +++ linux-2622-rc6/sound/oss/sb_card.c
> @@ -290,7 +290,7 @@ static struct pnp_card_driver sb_pnp_dri
>  MODULE_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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ALSA: more section mismatches
@ 2007-06-28 22:05 Randy Dunlap
  2007-06-28 22:39 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2007-06-28 22:05 UTC (permalink / raw)
  To: lkml; +Cc: perex, akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

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 <randy.dunlap@oracle.com>
---
 sound/drivers/mts64.c |    2 +-
 sound/oss/sb_card.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-2622-rc6.orig/sound/drivers/mts64.c
+++ linux-2622-rc6/sound/drivers/mts64.c
@@ -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;
 
--- linux-2622-rc6.orig/sound/oss/sb_card.c
+++ linux-2622-rc6/sound/oss/sb_card.c
@@ -290,7 +290,7 @@ static struct pnp_card_driver sb_pnp_dri
 MODULE_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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-29 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-23 21:58 [PATCH] ALSA: more section mismatches Randy Dunlap
2007-06-28 22:05 Randy Dunlap
2007-06-28 22:39 ` Andrew Morton
2007-06-28 23:49   ` Adrian Bunk
2007-06-29 17:26   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).