linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thunder from the hill <thunder@lightweight.ods.org>
To: Peter Chubb <peter@chubb.wattle.id.au>
Cc: Lightweight Patch Manager <patch@luckynet.dynu.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Tomas Szepe <szepe@pinerecords.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH][2.5] Single linked lists for Linux
Date: Thu, 26 Sep 2002 00:42:11 -0600 (MDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0209260038500.7827-100000@hawkeye.luckynet.adm> (raw)
In-Reply-To: <15762.20827.271317.595537@wombat.chubb.wattle.id.au>

Hi,

On Thu, 26 Sep 2002, Peter Chubb wrote:
> +/**
> + * slist_del -	remove an entry from list
> + * @head:	head to remove it from
> + * @entry:	entry to be removed
> + */
> +#define slist_del(_head, _entry)		\
> +do {						\
> +	(_head)->next = (_entry)->next;		\
> +	(_entry)->next = NULL;			\
> +}

What about

#define slist_del(_head)			\
do {						\
	typeof(_head) _entry = (_head)->next;	\
	(_head)->next = _entry->next;		\
	_entry->next = NULL;			\
} while (0)

> static inline int slist_del(struct slist *head, struct slist *entry)

I don't want to inline (just like once, with list.h) because I want any 
type to match here...

			Thunder
-- 
assert(typeof((fool)->next) == typeof(fool));	/* wrong */


  parent reply	other threads:[~2002-09-26  6:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <83015759@toto.iv>
2002-09-26  0:14 ` Peter Chubb
2002-09-26  0:25   ` Zwane Mwaikambo
2002-09-26  0:35   ` Rik van Riel
2002-09-26  6:42   ` Thunder from the hill [this message]
2002-09-25 20:56 Lightweight Patch Manager
2002-09-25 21:11 ` Rik van Riel
2002-09-25 21:23   ` Thunder from the hill
2002-09-25 21:17 ` Mark Mielke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0209260038500.7827-100000@hawkeye.luckynet.adm \
    --to=thunder@lightweight.ods.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=patch@luckynet.dynu.com \
    --cc=peter@chubb.wattle.id.au \
    --cc=szepe@pinerecords.com \
    --subject='Re: [PATCH][2.5] Single linked lists for Linux' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).