Messages in this thread | | | Date | Thu, 1 May 2008 13:32:09 -0700 | From | Arjan van de Ven <> | Subject | Re: [PATCH] Extend list debugging to cover hlists |
| |
On Fri, 2 May 2008 12:27:46 -0600 Matthew Wilcox <matthew@wil.cx> wrote:
> +void hlist_check(struct hlist_node *n) > +{ > + if (unlikely(*n->pprev != n)) { > + printk(KERN_ERR "hlist corruption. *pprev should be > %p, " > + "but was %p\n", n, *n->pprev); > + BUG(); > + } > + if (unlikely(n->next != NULL && n->next->pprev != &n->next)) > { > + printk(KERN_ERR "hlist corruption. n->next->pprev > should be" > + "%p, but was %p\n", &n->next, > n->next->pprev); > + BUG(); > + } > +} > +EXPORT_SYMBOL(hlist_check); >
Hi, I like the concept of the patch; however... BUG() is a tad on the rude side... how about WARN_ON(1) ?
| |