From: Kevin Corry <corryk@us.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Greg KH <greg@kroah.com>, Mark Peloquin <peloquin@us.ibm.com>,
torvalds@transmeta.com, linux-kernel@vger.kernel.org,
evms-devel@lists.sourceforge.net
Subject: Re: [PATCH] add safe version of list_for_each_entry() to list.h
Date: Fri, 4 Oct 2002 08:48:52 -0500 [thread overview]
Message-ID: <02100408485201.02266@boiler> (raw)
In-Reply-To: <20021004145850.B30064@infradead.org>
On Friday 04 October 2002 08:58, Christoph Hellwig wrote:
> > +/**
> > + * list_member - tests whether a list member is currently on a list
> > + * @member: member to evaulate
> > + */
> > +static inline int list_member(struct list_head *member)
> > +{
> > + return ((!member->next || !member->prev) ? 0 : 1);
>
> Wouldn't return (member->next && member->prev); be simpler?
Sure. New patch below with new list_member() function.
> > + */
> > +#define list_for_each_entry_safe(pos, n, head, member) \
> > + for (pos = list_entry((head)->next, typeof(*pos), member), \
> > + n = list_entry(pos->member.next, typeof(*pos), member); \
> > + &pos->member != (head); \
> > + pos = n, \
> > + n = list_entry(pos->member.next, typeof(*pos), member))
>
> Identation looks a little strange..
Perhaps. But there are plenty of places in list.h that have some strange
indenting. If you'd like it another way, please post a patch with your
preferred version.
--
Kevin Corry
corryk@us.ibm.com
http://evms.sourceforge.net/
next prev parent reply other threads:[~2002-10-04 14:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-03 23:42 [PATCH] add safe version of list_for_each_entry() to list.h Mark Peloquin
2002-10-03 23:44 ` Greg KH
2002-10-04 0:25 ` Kevin Corry
2002-10-04 13:58 ` Christoph Hellwig
2002-10-04 13:48 ` Kevin Corry [this message]
2002-10-04 13:51 ` Kevin Corry
-- strict thread matches above, loose matches on Subject: below --
2002-10-04 15:05 Matthew Wilcox
2002-10-04 15:48 Mark Peloquin
2002-10-04 16:00 ` Matthew Wilcox
2002-10-04 16:33 ` Andrew Morton
2002-10-04 16:40 Mark Peloquin
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=02100408485201.02266@boiler \
--to=corryk@us.ibm.com \
--cc=evms-devel@lists.sourceforge.net \
--cc=greg@kroah.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peloquin@us.ibm.com \
--cc=torvalds@transmeta.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox