Re: [patch 11/20] hlist: Add hlist_is_last_node() helper
From: Paolo Bonzini
Date: Mon Jun 13 2016 - 06:27:15 EST
On 13/06/2016 10:40, Thomas Gleixner wrote:
> /*
> + * Check whether the node is the last node of the head without
> + * accessing head.
> + */
> +static inline bool hlist_is_last_node(struct hlist_node *n,
> + struct hlist_head *h)
> +{
> + return !n->next && n->pprev == &h->first;
> +}
Perhaps hlist_is_only_node, or hlist_is_singular_node (which is ugly but
matches list_is_singular)? last_node seems to check only for !n->next.
Thanks,
Paolo