I have no idea, but in python the __ (double underscore) preceding a function name says.. "special function" .. you would do that for main function (even though it would be "__main__").
Now __init__ in python is just the constructor of a class.
Now taking a better look at your question makes me think that what I just said does not apply and that __init is just a gcc keyword which does something... mysterious.
These are only macros to locate some parts of the linux code into special areas in the final executing binary. __init for example (or better the __attribute__ ((__section__ (".init.text"))) this macro expands to) instructs the compiler to mark this function in a special way. At the end the linker collects all functions with this mark at the end (or begin) of the binary file. When the kernel starts, this code runs only once (initialization). After it runs, the kernel can free this memory to reuse it and you will see the kernel message: Freeing unused kernel memory: 108k freed
To use this feature, you need a special linker script file, that tells the linker where to locate all the marked functions. (see arch/arm/kernel/vmlinux.lds.S)
The __init macro tells the compiler that the associate function or variable is used only upon initialization. The compiler places all code marked with __init into a special memory section that is freed after the initialization phase ends.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.