On Tue, 06 Jan 2015 15:07:17 +0530, nawab said:
hi friends ,
i have a simple doubt when i was looking on linux/list.h
I have seen that INIT_LIST_HEAD and LIST_HEAD_INIT are performing the same functionality,the major difference is the argument passed.
When we have to use INIT_LIST_HEAD and LIST_HEAD_INIT??
At the risk of sounding snarky - you use INIT_LIST_HEAD when you have an argument of the type it takes, and you use LIST_INIT_HEAD when you have something of the type that *that* one takes. Just like math.h gives us: double sin(double x); float sinf(float x); so if you have a float, you call sinf() and if you have a double, you call sin(). (Hint: One looks suspiciously like a data initializer, the other looks like executable code.... :)