From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933406AbcGGIqP (ORCPT ); Thu, 7 Jul 2016 04:46:15 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39360 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932619AbcGGIqE (ORCPT ); Thu, 7 Jul 2016 04:46:04 -0400 Date: Thu, 7 Jul 2016 01:44:25 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: linux@sciencehorizons.net, peterz@infradead.org, fweisbec@gmail.com, torvalds@linux-foundation.org, edumazet@google.com, linux-kernel@vger.kernel.org, josh@joshtriplett.org, clm@fb.com, riel@redhat.com, paulmck@linux.vnet.ibm.com, arjan@infradead.org, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, lenb@kernel.org Reply-To: edumazet@google.com, torvalds@linux-foundation.org, fweisbec@gmail.com, peterz@infradead.org, linux@sciencehorizons.net, clm@fb.com, riel@redhat.com, josh@joshtriplett.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, arjan@infradead.org, paulmck@linux.vnet.ibm.com, lenb@kernel.org, mingo@kernel.org In-Reply-To: <20160704094341.867631372@linutronix.de> References: <20160704094341.867631372@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] hlist: Add hlist_is_singular_node() helper Git-Commit-ID: 15dba1e37b5cfd7fab9bc84e0f05f35c918f4eef X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 15dba1e37b5cfd7fab9bc84e0f05f35c918f4eef Gitweb: http://git.kernel.org/tip/15dba1e37b5cfd7fab9bc84e0f05f35c918f4eef Author: Thomas Gleixner AuthorDate: Mon, 4 Jul 2016 09:50:27 +0000 Committer: Ingo Molnar CommitDate: Thu, 7 Jul 2016 10:35:07 +0200 hlist: Add hlist_is_singular_node() helper Required to figure out whether the entry is the only one in the hlist. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Cc: Arjan van de Ven Cc: Chris Mason Cc: Eric Dumazet Cc: George Spelvin Cc: Josh Triplett Cc: Len Brown Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Rik van Riel Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20160704094341.867631372@linutronix.de Signed-off-by: Ingo Molnar --- include/linux/list.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/list.h b/include/linux/list.h index 5356f4d..5183138 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -679,6 +679,16 @@ static inline bool hlist_fake(struct hlist_node *h) } /* + * 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. */