It is a universal truth that with or without the extern keyword a function prototype will just do the same. So, why does almost all function prototypes in Linux kernel source code prefixed with the extern keyword?
Looking at Getting the offset of a member in a struct, I realized that you can also use the same technique to get the size of a member of a struct or a union without declaring a variable of that struct. Suppose a struct has been defined as follows:
struct person
{
int id;
char name [50];
double salary;
};
struct aligned_struct
{
char a [5];
int b;
};
I found in Linux kernel 2.6.21.5 in include/net/netinet_hastables.h in function __inet_lookup this interesting expression:
return sk ? : __inet_lookup_listener(hashinfo, daddr, hnum, dif);