From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965378AbcFMK1L (ORCPT ); Mon, 13 Jun 2016 06:27:11 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34804 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964910AbcFMK1J (ORCPT ); Mon, 13 Jun 2016 06:27:09 -0400 Subject: Re: [patch 11/20] hlist: Add hlist_is_last_node() helper To: Thomas Gleixner , LKML References: <20160613070440.950649741@linutronix.de> <20160613075929.097956101@linutronix.de> Cc: Ingo Molnar , Peter Zijlstra , "Paul E. McKenney" , Eric Dumazet , Frederic Weisbecker , Chris Mason , Arjan van de Ven , rt@linutronix.de From: Paolo Bonzini Message-ID: Date: Mon, 13 Jun 2016 12:27:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160613075929.097956101@linutronix.de> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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