From: "Jan Beulich" Subject: [PATCH] linux-2.6.18: add list_first_entry() Date: Wed, 03 Nov 2010 14:32:43 +0000 Message-ID: <4CD1809B02000078000206A7@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part1C318C9B.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part1C318C9B.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... to address build failure after c/s 1045:bd2bf7a84686. Signed-off-by: Jan Beulich --- a/include/linux/list.h +++ b/include/linux/list.h @@ -354,6 +354,17 @@ static inline void list_splice_init(stru container_of(ptr, type, member) =20 /** + * list_first_entry - get the first element from a list + * @ptr: the list head to take the element from. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + * + * Note, that list is expected to be not empty. + */ +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + +/** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop cursor. * @head: the head for your list. --=__Part1C318C9B.0__= Content-Type: text/plain; name="list-first-entry.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="list-first-entry.patch" Subject: add list_first_entry()=0A=0A... to address build failure after = c/s 1045:bd2bf7a84686.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/include/linux/list.h=0A+++ b/include/linux/list.h=0A@@ -354,6 = +354,17 @@ static inline void list_splice_init(stru=0A container_of(ptr, = type, member)=0A =0A /**=0A+ * list_first_entry - get the first element = from a list=0A+ * @ptr: the list head to take the element from.=0A+ * = @type: the type of the struct this is embedded in.=0A+ * @member: = the name of the list_struct within the struct.=0A+ *=0A+ * Note, that list = is expected to be not empty.=0A+ */=0A+#define list_first_entry(ptr, type, = member) \=0A+ list_entry((ptr)->next, type, member)=0A+=0A+/**=0A * = list_for_each - iterate over a list=0A * @pos: the &struct = list_head to use as a loop cursor.=0A * @head: the head for your list.=0A --=__Part1C318C9B.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part1C318C9B.0__=--