Commit 5f216652 authored by Marcin Ślusarz's avatar Marcin Ślusarz Committed by Marge Bot

util/list: use helper function in list_is_singular

Signed-off-by: Marcin Ślusarz's avatarMarcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
Part-of: <!8110>
parent a9bcb10e
......@@ -124,7 +124,7 @@ static inline bool list_is_linked(const struct list_head *list)
*/
static inline bool list_is_singular(const struct list_head *list)
{
return list_is_linked(list) && list->next != list && list->next->next == list;
return list_is_linked(list) && !list_is_empty(list) && list->next->next == list;
}
static inline unsigned list_length(const struct list_head *list)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment