Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 26 Sep 2002 02:30:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 26 Sep 2002 02:30:22 -0400 Received: from pD9E23892.dip.t-dialin.net ([217.226.56.146]:45796 "EHLO hawkeye.luckynet.adm") by vger.kernel.org with ESMTP id ; Thu, 26 Sep 2002 02:30:21 -0400 Date: Thu, 26 Sep 2002 00:36:07 -0600 (MDT) From: Thunder from the hill X-X-Sender: thunder@hawkeye.luckynet.adm To: Rik van Riel cc: Lightweight Patch Manager , Linux Kernel Mailing List , Tomas Szepe , Ingo Molnar Subject: Re: [PATCH][2.5] Single linked lists for Linux,v2 In-Reply-To: Message-ID: X-Location: Dorndorf/Steudnitz; Germany MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 36 Hi, On Wed, 25 Sep 2002, Rik van Riel wrote: > > +#define INIT_SLIST_HEAD(name) \ > > + (name->next = name) > > + > > +#define SLIST_HEAD(type,name) \ > > + typeof(type) name = INIT_SLIST_HEAD(name) > > Fun, so the list head points to itself ... > > > +#define slist_for_each(pos, head) \ > > + for (pos = head; pos && ({ prefetch(pos->next); 1; }); \ > > + pos = pos->next) > > ... imagine what that would do in combination with this macro. I'm aware of that possibility. What would you initialize it to, if not the list itself? (And BTW, anyone have a solution for slist_add()?) We could set it to NULL, but where would we end? #define INIT_SLIST_HEAD(name) \ (name->next = NULL) #define SLIST_HEAD_INIT(name) name Thunder -- assert(typeof((fool)->next) == typeof(fool)); /* wrong */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/