From: Domen Puncer <domen.puncer@telargo.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Sam Ravnborg <sam@ravnborg.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] introduce __init_exit function annotation
Date: Tue, 17 Jul 2007 19:48:40 +0200 [thread overview]
Message-ID: <20070717174840.GN2400@nd47.coderock.org> (raw)
In-Reply-To: <s5hir8jujhc.wl%tiwai@suse.de>
On 17/07/07 17:40 +0200, Takashi Iwai wrote:
> At Tue, 17 Jul 2007 17:32:36 +0200,
> Sam Ravnborg wrote:
> >
> > On Tue, Jul 17, 2007 at 05:16:13PM +0200, Takashi Iwai wrote:
> > > At Tue, 17 Jul 2007 17:14:32 +0200,
> > > Sam Ravnborg wrote:
> > > >
> > > > On Tue, Jul 17, 2007 at 04:52:12PM +0200, Takashi Iwai wrote:
> > > > > At Tue, 17 Jul 2007 15:02:30 +0200,
> > > > > Sam Ravnborg wrote:
> > > > > >
> > > > > > On Tue, Jul 17, 2007 at 10:02:48AM +0200, Domen Puncer wrote:
> > > > > > > Introduce __init_exit, which is useful ie. for drivers that call
> > > > > > > cleanup functions when they fail in __init functions.
> > > > > >
> > > > > > This is wrong.
> > > > > > On arm (just one example of several) the __exit section are discarded
> > > > > > at buildtime so any reference from __init to __exit will cause the
> > > > > > linker to error out.
> > > > >
> > > > > Hmm, from what I see, it adds __init to the function. There is no
> > > > > reference to __exit.
> > > >
> > > > The cleanup functions are marked __exit in the referenced case.
> > >
> > > My understanding is that it's the very purpose of this patch --
> > > change the mark from __exit to __init_exit for such clean-up
> > > functions.
> >
> > And that is wrong.
>
> You misunderstood. What I meant is the case like this:
>
> static void __init_exit cleanup()
> {
> ...
> }
>
> static void __init foo_init()
> {
> if (error)
> cleanup();
> }
>
> static void __exit foo_exit()
> {
> cleanup();
> }
Uh, yes, this, or just __init_exit foo_exit() as in Sam's example.
It seemed obvious to me, sorry.
>
> Currently, there is no proper way to mark cleanup(). Neither __init,
> __exit, __devinit nor __devexit can be used there.
>
>
> Takashi
prev parent reply other threads:[~2007-07-17 18:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-17 8:02 [PATCH] introduce __init_exit function annotation Domen Puncer
2007-07-17 8:31 ` Adrian Bunk
2007-07-17 8:55 ` Domen Puncer
2007-07-17 13:02 ` Sam Ravnborg
2007-07-17 14:52 ` Takashi Iwai
2007-07-17 15:14 ` Sam Ravnborg
2007-07-17 15:16 ` Takashi Iwai
2007-07-17 15:32 ` Sam Ravnborg
2007-07-17 15:40 ` Takashi Iwai
2007-07-17 16:48 ` Sam Ravnborg
2007-07-17 17:02 ` Takashi Iwai
2007-07-17 19:44 ` Domen Puncer
2007-07-17 17:48 ` Domen Puncer [this message]
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=20070717174840.GN2400@nd47.coderock.org \
--to=domen.puncer@telargo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=tiwai@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.