On Sat, Sep 03, 2016 at 07:33:29AM +0200, Christophe JAILLET wrote:You are right but if you dig further you will see that calling INIT_LIST_HEAD on an empty list is a no-op (AFAIK).
Calling 'list_splice' followed by 'INIT_LIST_HEAD' is equivalent toIt is not 100% accurate
'list_splice_init'.
list_splice(y, z)
INIT_LIST_HEAD(y)
==>
if (!list_empty(y))
__list_splice(y, z, z>next);
INIT_LIST_HEAD(y)
and not
if (!list_empty(y)) {
__list_splice(y, z, z>next);
INIT_LIST_HEAD(y)
}
as list_splice_init will do.