From 5dd1f5b73967751f3f110d8f71028e0dd28da15f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 18 Nov 2020 16:53:48 +0100 Subject: [PATCH] tupperware: list: add INIT_VAL macro --- include/tupperware/list.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/tupperware/list.h b/include/tupperware/list.h index 895f2d8..96a12ba 100644 --- a/include/tupperware/list.h +++ b/include/tupperware/list.h @@ -35,6 +35,12 @@ struct list { ? NULL \ : CONTAINER_OF(Type, Field, (Cur)->Field.next))) +#define LIST_NODE_INIT_VAL \ + ((struct list_node){ \ + .next = NULL, \ + .prev = NULL, \ + }) + typedef int (*list_cmp_f)(const struct list_node *lhs, const struct list_node *rhs, void *cookie);