Difference between INIT_LIST_HEAD and LIST_HEAD_INIT

Chen Weixiang weixiangx.chen at outlook.com
Tue Jan 6 11:26:00 EST 2015


> >
> > When we have to use INIT_LIST_HEAD and LIST_HEAD_INIT??
> 

I believe it's better to use macro LIST_HEAD(name) to define and
initialize a variable of type 'struct list_head'.

The method INIT_LIST_HEAD() is used to initialize a predefined variable
of type 'struct list_head'.

-- 
Best regards,
Chen Weixiang (Alex)




More information about the Kernelnewbies mailing list