git: 8240c14d2e80 - stable/13 - linuxkpi: Move definition of `struct list_head` to <linux/types.h>

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Thu, 16 Feb 2023 11:56:27 UTC
The branch stable/13 has been updated by dumbbell (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=8240c14d2e80ac73e7bfa7f2ee12f17d8020da3d

commit 8240c14d2e80ac73e7bfa7f2ee12f17d8020da3d
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2023-02-09 12:11:34 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2023-02-16 11:55:19 +0000

    linuxkpi: Move definition of `struct list_head` to <linux/types.h>
    
    This is the case on Linux.
    
    Reviewed by:    manu
    Approved by:    manu
    Differential Revision:  https://reviews.freebsd.org/D38537
    
    (cherry picked from commit 54606590dffcd23136af1c26da38206f4d3a6269)
---
 sys/compat/linuxkpi/common/include/linux/list.h  | 8 --------
 sys/compat/linuxkpi/common/include/linux/types.h | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/list.h b/sys/compat/linuxkpi/common/include/linux/list.h
index 6ec715291807..46da7cc7bc8e 100644
--- a/sys/compat/linuxkpi/common/include/linux/list.h
+++ b/sys/compat/linuxkpi/common/include/linux/list.h
@@ -86,14 +86,6 @@
 #define LINUX_LIST_HEAD(name) \
 	struct list_head name = LINUX_LIST_HEAD_INIT(name)
 
-#ifndef LIST_HEAD_DEF
-#define	LIST_HEAD_DEF
-struct list_head {
-	struct list_head *next;
-	struct list_head *prev;
-};
-#endif
-
 static inline void
 INIT_LIST_HEAD(struct list_head *list)
 {
diff --git a/sys/compat/linuxkpi/common/include/linux/types.h b/sys/compat/linuxkpi/common/include/linux/types.h
index dab5e6ddce42..aa19163ddd26 100644
--- a/sys/compat/linuxkpi/common/include/linux/types.h
+++ b/sys/compat/linuxkpi/common/include/linux/types.h
@@ -79,6 +79,14 @@ typedef	unsigned long	kernel_ulong_t;
 
 typedef unsigned long irq_hw_number_t;
 
+#ifndef LIST_HEAD_DEF
+#define	LIST_HEAD_DEF
+struct list_head {
+	struct list_head *next;
+	struct list_head *prev;
+};
+#endif
+
 struct rcu_head {
 	void *raw[2];
 } __aligned(sizeof(void *));