I came across the following declaration in the device driver programming:
static int __init sum_init(void)
I have seen static int sum_init(void)
. Why does the above declaration not give compilation errors?
I came across the following declaration in the device driver programming:
static int __init sum_init(void)
I have seen static int sum_init(void)
. Why does the above declaration not give compilation errors?
Because probably __init
is some sort of #define
that is assigned to anything that won't cause a compilation error.
#define __init
Or...
#define __init __section(.init.text) __cold notrace
Its just like saying:
static int __init sum_init()
{
return 0;
}
It doesn't return any value so no errors were occurred.