Re: [PATCH] 2.5.39 list_head debugging
Dave Jones (davej@codemonkey.org.uk)
Sun, 29 Sep 2002 18:22:47 +0100
On Sun, Sep 29, 2002 at 01:58:52AM -0400, Zach Brown wrote:
> +static inline struct list_head * __list_valid(struct list_head *list)
> +{
> + BUG_ON(list == NULL);
> + BUG_ON(list->next == NULL);
> + BUG_ON(list->prev == NULL);
> + BUG_ON(list->next->prev != list);
> + BUG_ON(list->prev->next != list);
> + BUG_ON((list->next == list) && (list->prev != list));
> + BUG_ON((list->prev == list) && (list->next != list));
> +
> + return list;
> +}
> +#else
> +
> +#define __list_valid(args...)
> +
> +#endif
Two points (both related to return type).
1, why is it needed ? none of the macros seems to check it.
2, will this work for the #define __list_valid(args...) case ?
Dave
--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/