0

What is the meaning of a __init qualifier to a function in this context:

http://lxr.free-electrons.com/source/drivers/thermal/of-thermal.c?v=3.16#L746

How does that function get executed?

tarabyte
  • 17,837
  • 15
  • 76
  • 117
  • Yeas, it's duplicate. `__init` means that function will be removed from RAM once initialization stage is done. Just to save some memory. – Sam Protsenko Nov 13 '15 at 21:07
  • And is there anything that can be done to ensure it executes? I don't understand how this gets called. Sorry I know out of scope of original question. – tarabyte Nov 13 '15 at 21:18
  • Sure. Just looking to how this function used further can tell you if it will be executed (well, if you are experienced enough). Also you can just put some `printk` trace to the beginning of that function and see if it appears in kernel log (`dmesg`). – Sam Protsenko Nov 14 '15 at 20:56
  • Look at [thermal_init()](http://lxr.free-electrons.com/source/drivers/thermal/thermal_core.c?v=3.16#L1819) function (line 1819). It's being called from there. Now see [where thermal_init() is called](http://lxr.free-electrons.com/ident?v=3.16;i=thermal_init) and try to figure out if it's gonna be executed on your platform or not. – Sam Protsenko Nov 14 '15 at 21:00

0 Answers0