[Mesa-dev] [PATCH 10/13] util/list: Add a list validation function
Jason Ekstrand
jason at jlekstrand.net
Tue May 5 11:35:35 PDT 2015
On Tue, May 5, 2015 at 11:25 AM, Neil Roberts <neil at linux.intel.com> wrote:
> Jason Ekstrand <jason at jlekstrand.net> writes:
>
>> +static inline void list_validate(struct list_head *list)
>> +{
>> + assert(list->next->prev == list && list->prev->next == list);
>> + for (struct list_head *node = list->next; node != list; node = node->next)
>> + assert(node->next->prev == node && node->prev->next == node);
>> +}
>
> It would be good if this #included assert.h. It might be nice to use one of
> the iterator macros too, although I guess that's just bikeshedding so
> I won't complain either way.
Rob pointed that out too. Fixed locally.
--Jason
> Regards,
> - Neil
More information about the mesa-dev
mailing list