diff options
Diffstat (limited to 'ccan/list/list.c')
-rw-r--r-- | ccan/list/list.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ccan/list/list.c b/ccan/list/list.c index 2717fa3..ba8e191 100644 --- a/ccan/list/list.c +++ b/ccan/list/list.c @@ -17,8 +17,8 @@ static void *corrupt(const char *abortstr, return NULL; } -struct list_node *list_check_node(const struct list_node *node, - const char *abortstr) +const struct list_node *list_check_node(const struct list_node *node, + const char *abortstr) { const struct list_node *p, *n; int count = 0; @@ -32,12 +32,13 @@ struct list_node *list_check_node(const struct list_node *node, if (node->prev != p) return corrupt(abortstr, node, node, 0); - return (struct list_node *)node; + return node; } -struct list_head *list_check(const struct list_head *h, const char *abortstr) +const struct list_head *list_check(const struct list_head *h, + const char *abortstr) { if (!list_check_node(&h->n, abortstr)) return NULL; - return (struct list_head *)h; + return h; } |