Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 27 06:55:43 UTC 2018

Modified Files:
        src/sys/external/bsd/common/include/linux: list.h

Log Message:
Define list_entry_first_or_null.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/common/include/linux/list.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/common/include/linux/list.h
diff -u src/sys/external/bsd/common/include/linux/list.h:1.9 src/sys/external/bsd/common/include/linux/list.h:1.10
--- src/sys/external/bsd/common/include/linux/list.h:1.9	Mon Aug 27 06:54:19 2018
+++ src/sys/external/bsd/common/include/linux/list.h	Mon Aug 27 06:55:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: list.h,v 1.9 2018/08/27 06:54:19 riastradh Exp $	*/
+/*	$NetBSD: list.h,v 1.10 2018/08/27 06:55:43 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -199,6 +199,8 @@ list_del_init(struct list_head *node)
 #define	list_entry(PTR, TYPE, FIELD)	container_of(PTR, TYPE, FIELD)
 #define	list_first_entry(PTR, TYPE, FIELD)				\
 	list_entry(list_first((PTR)), TYPE, FIELD)
+#define	list_first_entry_or_null(PTR, TYPE, FIELD)			\
+	(list_empty((PTR)) ? NULL : list_entry(list_first((PTR)), TYPE, FIELD))
 #define	list_last_entry(PTR, TYPE, FIELD)				\
 	list_entry(list_last((PTR)), TYPE, FIELD)
 #define	list_next_entry(ENTRY, FIELD)					\

Reply via email to