From: Sam Ravnborg <sam@ravnborg.org>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: rdunlap@xenotime.net, akpm@osdl.org, jgarzik@pobox.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] [2.6.17-rc6] Section mismatch in drivers/net/ne.o during modpost
Date: Sun, 11 Jun 2006 23:54:04 +0200 [thread overview]
Message-ID: <20060611215404.GA27380@mars.ravnborg.org> (raw)
In-Reply-To: <200606111437.k5BEbVu5021415@harpo.it.uu.se>
On Sun, Jun 11, 2006 at 04:37:31PM +0200, Mikael Pettersson wrote:
> On Sat, 10 Jun 2006 22:38:00 +0200, Sam Ravnborg wrote:
> >> --- linux-2617-rc6.orig/drivers/net/ne.c
> >> +++ linux-2617-rc6/drivers/net/ne.c
> >> @@ -829,7 +829,7 @@ that the ne2k probe is the last 8390 bas
> >> is at boot) and so the probe will get confused by any other 8390 cards.
> >> ISA device autoprobes on a running machine are not recommended anyway. */
> >>
> >> -int init_module(void)
> >> +int __init init_module(void)
> >> {
> >> int this_dev, found = 0;
> >
> >When you anyway touches the driver I suggest to name the function
> ><module>_init, <module>_cleanup and use module_init(), module_cleanup().
>
> Maybe not: in the ne.c driver init_module() is inside #ifdef MODULE,
> so conversion to ne_init() + module_init(ne_init) would be a no-op
> except for making the code larger. In the non-MODULE case Space.c
> calls ne_probe() directly.
The whole purpose of marking a function __init is to place in in a
section that can be discarded after init. This has the added advantage
that it kills off some ugly #ifdef MODULE / #endif as is the case for
ne.c
Even if not discarded then the code cleaniness is preferable to #ifdef /
#endif if purpose is only to save a few bytes.
Shifting to module_init(), module_cleanup() is the only right thing to
do - and the old behaviour is not even documented in LDD3 anymore.
[At least I did not find it last time I searched].
Sam
next prev parent reply other threads:[~2006-06-11 21:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-11 14:37 Mikael Pettersson
2006-06-11 21:54 ` Sam Ravnborg [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-06-11 0:51 Mikael Pettersson
2006-06-11 10:25 ` Jan Engelhardt
2006-06-13 5:35 ` Keith Owens
2006-06-13 15:11 ` Randy.Dunlap
2006-06-13 20:38 ` Sam Ravnborg
2006-06-10 12:11 Mikael Pettersson
2006-06-10 19:13 ` [PATCH] " Randy.Dunlap
2006-06-10 20:38 ` Sam Ravnborg
2006-06-11 10:23 ` Jan Engelhardt
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=20060611215404.GA27380@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@osdl.org \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@it.uu.se \
--cc=netdev@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/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
all inboxes | Powered by JetHome®