From patchwork Sat Feb 28 00:53:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 23848 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 5934ADDF0C for ; Sat, 28 Feb 2009 12:02:37 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from hera.kernel.org (hera.kernel.org [140.211.167.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 191EFDDDF6; Sat, 28 Feb 2009 11:59:33 +1100 (EST) Received: from hera.kernel.org (IDENT:U2FsdGVkX1+RvelEyjUvDyfJMZMWLNXNygGKhx45in4@localhost [127.0.0.1]) by hera.kernel.org (8.14.2/8.14.2) with ESMTP id n1S0xPO3016648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Feb 2009 00:59:25 GMT Received: (from geoff@localhost) by hera.kernel.org (8.14.2/8.13.1/Submit) id n1S0xPDv016647; Sat, 28 Feb 2009 00:59:25 GMT Message-Id: <20090228005350.334406316@am.sony.com> References: <20090228005350.203477145@am.sony.com> In-reply-to: <20090228005350.203477145@am.sony.com> User-Agent: quilt/0.46-1 Date: Fri, 27 Feb 2009 16:53:52 -0800 From: Geoff Levand To: Jeremy Kerr Content-Disposition: inline; filename=list-continue-each-entry.diff X-Virus-Scanned: ClamAV 0.93.3/9055/Fri Feb 27 20:16:01 2009 on hera.kernel.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Sat, 28 Feb 2009 00:59:27 +0000 (UTC) Cc: cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [patch 02/16] petitboot: Add list_for_each_entry_continue routine X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Add a new list iteration routine list_for_each_entry_continue(). Continues iteration from a user specified list item. Signed-off-by: Geoff Levand --- lib/list/list.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/lib/list/list.h +++ b/lib/list/list.h @@ -30,6 +30,10 @@ struct list { &pos->member != &(list)->head; \ pos = list_entry(pos->member.next, typeof(*pos), member)) +#define list_for_each_entry_continue(_list, _pos, _member) \ + for (; &_pos->_member != &(_list)->head; \ + _pos = list_entry(_pos->_member.next, typeof(*_pos), _member)) + void list_init(struct list *list); void list_insert_before(struct list_item *next, struct list_item *new); void list_insert_after(struct list_item *prev, struct list_item *new);