public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Valette <Eric.Valette@Free.fr>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "\"??????? <\\\"Paul Rolland \\\"\"" <rol@witbe.net>,
	"Rob Hussey" <robjhussey@gmail.com>,
	flamingice@sourmilk.net, andreamrl@tiscali.it,
	linux-kernel@vger.kernel.org
Subject: Re: rtl8187 driver in 2.6.23-rc6-git5: kernel panic if not used as a module. Works as a module.
Date: Mon, 17 Sep 2007 13:44:44 +0200	[thread overview]
Message-ID: <46EE68AC.3090809@Free.fr> (raw)
In-Reply-To: <1190022515.3934.4.camel@localhost>

Johannes Berg wrote:
> On Sa, 2007-09-15 at 21:00 +0200, Eric Valette wrote:
>
>   
>> I came to this conclusion too. But I would have preferred to have
>> #define subsys_exit(fn)			modules_exit(fn)
>>
>> in the case of a module and nop in the non module case...
>>     
>
> module_exit is a no-op anyway in the non-modular case, it's never
> called, so what's the point?
>   
That I would have prefered to see subsys_exit in front of
subsys_initcall instead of module_exit because
     1) it made me wonder if it still works in the module case
     2) If you see the comment in init.h (/* Don't use these in modules,
but some people do... */), you should not use it in module. The comment
is, at least misleading, because for code that can be used as module or
directly embedded in some cases you are indeed forced to use it (did a
grep and found a lot)
     3) Non symetrical code frequently points to errors or bad design.
YMMV :-)
     4) If someone someday find something to do when shutting down
(hotrestart, fault tolerance,  or something equivalent), we would have a
place to hook. C++ has destructors called after main and before __exit...

NB : This has nothing to do with the proposed patch that is definitively
correct given current init.h.

Personally, I would certainly add:

#define subsys_exit(fn) in init.h

But would rate it myself as a cosmetic change as it *only* makes the code more obvious to read :-)

-- eric


  reply	other threads:[~2007-09-17 12:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-15 14:07 rtl8187 driver in 2.6.23-rc6-git5: kernel panic if not used as a module. Works as a module Eric Valette
2007-09-15 14:27 ` Eric Valette
2007-09-15 15:38   ` Paul Rolland
2007-09-15 16:28   ` Rob Hussey
2007-09-15 17:41     ` Paul Rolland
2007-09-15 18:30     ` Eric Valette
2007-09-15 18:51       ` Paul Rolland
2007-09-15 19:00         ` Eric Valette
2007-09-17  9:48           ` Johannes Berg
2007-09-17 11:44             ` Eric Valette [this message]
2007-09-15 21:19         ` Rob Hussey
2007-09-25  8:05           ` Eric Valette

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=46EE68AC.3090809@Free.fr \
    --to=eric.valette@free.fr \
    --cc=andreamrl@tiscali.it \
    --cc=flamingice@sourmilk.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robjhussey@gmail.com \
    --cc=rol@witbe.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