automatic __init (etc.) propagation

Thomas Hood (jdthood@mail.com)
13 Nov 2001 16:27:17 -0500


I have just been preparing a patch for parport_pc.c
and had the unpleasant experience of having to decide
whether certain functions should be tagged "__init" or
"__devinit", etc. I assume that if I incorrectly label
a function "__init" then an oops will result when the
function is called after init time; and if I incorrectly
fail to label a function with "__init" then it will be dead
code after init time. Similarly, if I incorrectly label
a function "__devinit" then an oops will result when the
function is called after init time (unless the driver is
compiled with HOTPLUG); and if I incorrectly fail to label
a function with "__devinit" then it will be dead code
after init time (unless the driver is compiled with HOTPLUG,
in which case __devinit makes no difference).

Would it not be possible for this to be handled automatically?
That is, would it not be possible to set things up so that we
tag just the module init function with '__init' and all
those functions (that aren't exported) called only by __init
functions will automatically be treated as __init functions
too? And similarly with __devinit functions? Thoughts?

--
Thomas Hood

- 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/