missing mini-os list_top macro
PATCH 1/1 missing mini-os list_top macro
mini-os is missing list_top in its list.h
---
extras/mini-os/include/list.h +6 -0
@@ -23,6 +23,12 @@#define INIT_LIST_HEAD (ptr) do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) + +#define list_top (head, type, member) \ +({ \ + struct list_head *_head = (head); \ + list_empty(_head) ? NULL : list_entry(_head->next, type, member); \ +})/* * Insert a new entry between two known consecutive entries.