- llist_for_each(pos, n, &pile->partial, cakes)
- {
- if (pos->next_free != EO_FREE_PIECE) {
- goto found;
- }
- }
-
- if (llist_empty(&pile->free)) {
+ if (!llist_empty(&pile->partial)) {
+ pos = list_entry(pile->partial.next, typeof(*pos), cakes);
+ } else if (llist_empty(&pile->free)) {