From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752037AbcFXOi4 (ORCPT ); Fri, 24 Jun 2016 10:38:56 -0400 Received: from www.linutronix.de ([62.245.132.108]:53150 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555AbcFXOeO (ORCPT ); Fri, 24 Jun 2016 10:34:14 -0400 Message-Id: <20160624141722.344114543@linutronix.de> User-Agent: quilt/0.63-1 Date: Fri, 24 Jun 2016 14:32:11 -0000 From: Thomas Gleixner To: LKML Cc: Ingo Molnar , Peter Zijlstra , "Paul E. McKenney" , Eric Dumazet , Frederic Weisbecker , Chris Mason , Arjan van de Ven , rt@linutronix.de, Rik van Riel , Linus Torvalds , George Spelvin , Len Brown , Josh Triplett Subject: [patch V3 11/22] hlist: Add hlist_is_singular_node() helper References: <20160624140325.554996200@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=hlist_Add_hlist_is_last_node()_helper.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Required to figure out whether the entry is the only one in the hlist. Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Frederic Weisbecker Cc: Chris Mason Cc: Eric Dumazet Cc: rt@linutronix.de Cc: "Paul E. McKenney" Cc: Arjan van de Ven --- include/linux/list.h | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/include/linux/list.h +++ b/include/linux/list.h @@ -679,6 +679,16 @@ static inline bool hlist_fake(struct hli } /* + * Check whether the node is the only node of the head without + * accessing head. + */ +static inline bool hlist_is_singular_node(struct hlist_node *n, + struct hlist_head *h) +{ + return !n->next && n->pprev == &h->first; +} + +/* * Move a list from one list head to another. Fixup the pprev * reference of the first entry if it exists. */