diff options
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 945daa1f13dd..47208bd99f9e 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -34,9 +34,11 @@ struct list_head { | |||
34 | #define LIST_HEAD(name) \ | 34 | #define LIST_HEAD(name) \ |
35 | struct list_head name = LIST_HEAD_INIT(name) | 35 | struct list_head name = LIST_HEAD_INIT(name) |
36 | 36 | ||
37 | #define INIT_LIST_HEAD(ptr) do { \ | 37 | static inline void INIT_LIST_HEAD(struct list_head *list) |
38 | (ptr)->next = (ptr); (ptr)->prev = (ptr); \ | 38 | { |
39 | } while (0) | 39 | list->next = list; |
40 | list->prev = list; | ||
41 | } | ||
40 | 42 | ||
41 | /* | 43 | /* |
42 | * Insert a new entry between two known consecutive entries. | 44 | * Insert a new entry between two known consecutive entries. |
@@ -534,7 +536,11 @@ struct hlist_node { | |||
534 | #define HLIST_HEAD_INIT { .first = NULL } | 536 | #define HLIST_HEAD_INIT { .first = NULL } |
535 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } | 537 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } |
536 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) | 538 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) |
537 | #define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL) | 539 | static inline void INIT_HLIST_NODE(struct hlist_node *h) |
540 | { | ||
541 | h->next = NULL; | ||
542 | h->pprev = NULL; | ||
543 | } | ||
538 | 544 | ||
539 | static inline int hlist_unhashed(const struct hlist_node *h) | 545 | static inline int hlist_unhashed(const struct hlist_node *h) |
540 | { | 546 | { |