Why does kernel provide "module" macro?

Nan Xiao xiaonan830818 at gmail.com
Mon Nov 16 23:07:32 EST 2015

Hi all,

I find there are some code in kernel likes this:

#ifdef MODULE
static struct net_device *dev_82596;

So I guess the function of "MODULE" is to build the code as a module.

Why do we need this macro? Is some code need specific processing when
building as
a module or into kernel binary?

Thanks in advance!

Best Regards
Nan Xiao

More information about the Kernelnewbies mailing list