Function Pointer Question

Sudip Mukherjee sudipm.mukherjee at gmail.com
Thu Apr 2 07:27:38 EDT 2015


> I looked in to it and the kernel seems to be one of the few places where this is done along with in line functions.  Why do we need function pointers in the kernel, outside of device drivers is my real question and is there any way to do the code using them without function pointers at all, I am assuming no.

Suppose you are registering a pci driver, and you are telling the pci
layer that function xyz()  is your probe function. incidentally, there
is also another driver which is also having a probe function called
xyz(). if you do not give the pointer to your function and pci layer
starts calling the functions by its name , then which xyz() should be
executed now???

regards
sudip

> Thanks,
> Nick



More information about the Kernelnewbies mailing list