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 == NULL
head->prev == NULL