list_empty()関数はで定義され./include/linux/list.h、その定義は
static inline int list_empty(const struct list_head *head)
{
return head->next == head;
}
list_headデータ構造は次のように定義されます
struct list_head {
struct list_head *next, *prev;
};
私が理解していないのは、カーネルでのこの実装が&&head->next == headではなくチェックする理由です。head->next == NULLhead->prev == NULL