diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/kernel.h | 3 | ||||
-rw-r--r-- | include/linux/list.h | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 35a7207e..f9a57129 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -278,4 +278,7 @@ static inline void dump_stack(void) {} #define unsafe_memcpy(dst, src, bytes, justification) \ memcpy(dst, src, bytes) +#define DECLARE_FLEX_ARRAY(TYPE, NAME) \ + __DECLARE_FLEX_ARRAY(TYPE, NAME) + #endif diff --git a/include/linux/list.h b/include/linux/list.h index bdd09efa..d176d0d3 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -98,4 +98,15 @@ static inline void hlist_del_init(struct hlist_node *n) pos; \ pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) +static inline size_t list_count_nodes(struct list_head *head) +{ + struct list_head *pos; + size_t count = 0; + + list_for_each(pos, head) + count++; + + return count; +} + #endif /* _LIST_LIST_H */ |