Commit 2102213c authored by Cody P Schafer's avatar Cody P Schafer Committed by Rusty Russell

list: add parens to gaurd macro args in LIST_INIT

When other macros are emitting LIST_INIT expansions, `name` can get a
bit complicated.
Signed-off-by: default avatarCody P Schafer <dev@codyps.com>
parent f3538fc7
......@@ -111,7 +111,7 @@ struct list_node *list_check_node(const struct list_node *n,
* Example:
* static struct list_head my_list = LIST_HEAD_INIT(my_list);
*/
#define LIST_HEAD_INIT(name) { { &name.n, &name.n } }
#define LIST_HEAD_INIT(name) { { &(name).n, &(name).n } }
/**
* LIST_HEAD - define and initialize an empty list_head
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment