lkml.org 
[lkml]   [2003]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Non-__init functions calling __init functions
Andrzej Krzysztofowicz wrote:

> Not always possible.
>
> __init A() {
> ...
> }
>
> __exit B() {
> ...
> }
>
> C() {
> ...
> A();
> ...
> #ifdef MODULE
> B();
> #endif
> ...
> }
>
> C cannot be marked __init for #define MODULE case. Even if it is called only
> by some __init code. I can imagine other similar situations.

I thought that in the case of modules, __init is a noop? At least, that's what
this page says

http://www.netfilter.org/unreliable-guides/kernel-hacking/routines-init.html

So if MODULE is defined, it doesn't matter if C is labelled as __init or not,
and if it is not defined, it *should* be labelled as __init since it is itself
calling __init code.

Chris


--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.082 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site