/* Each module must use one module_init(). */
#define module_init(initfn) \
static inline initcall_t __inittest(void) \
{ return initfn; } \
int init_module(void) __attribute__((alias(#initfn)));
The sole purpose of the generated __inittest() function it to check during compile time, that the function passed to module_init() macro is compatible with the initcall_t type.
All module initialization functions must conform to the type, since (as can be seen from the init_module() definition) they are not called directly, but rather are called via special aliased name init_module().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With