- if (list_count(&caps_stack))
- {
struct caps_stack *entry, *cursor;
ERR("%i unpopped device caps on the stack\n", list_count(&caps_stack));
LIST_FOR_EACH_ENTRY_SAFE(entry, cursor, &caps_stack, struct caps_stack, entry)
list_remove(&entry->entry);
- }
If you only want to check if there's any elements left, it's faster to do list_empty().