public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
	lkml <linux-kernel@vger.kernel.org>,
	perex@suse.cz
Subject: Re: [PATCH] ALSA: more section mismatches
Date: Fri, 29 Jun 2007 01:49:49 +0200	[thread overview]
Message-ID: <20070628234949.GF6087@stusta.de> (raw)
In-Reply-To: <20070628153949.8582d3a4.akpm@linux-foundation.org>

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


  reply	other threads:[~2007-06-28 23:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-28 22:05 [PATCH] ALSA: more section mismatches Randy Dunlap
2007-06-28 22:39 ` Andrew Morton
2007-06-28 23:49   ` Adrian Bunk [this message]
2007-06-29 17:26   ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2007-06-23 21:58 Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070628234949.GF6087@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=randy.dunlap@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox