5 static void *corrupt(const char *abortstr,
6 const struct list_node *head,
7 const struct list_node *node,
12 "%s: prev corrupt in node %p (%u) of %p\n",
13 abortstr, node, count, head);
19 struct list_node *list_check_node(const struct list_node *node,
22 const struct list_node *p, *n;
25 for (p = node, n = node->next; n != node; p = n, n = n->next) {
28 return corrupt(abortstr, node, n, count);
30 /* Check prev on head node. */
32 return corrupt(abortstr, node, node, 0);
34 return (struct list_node *)node;
37 struct list_head *list_check(const struct list_head *h, const char *abortstr)
39 if (!list_check_node(&h->n, abortstr))
41 return (struct list_head *)h;