git: 84f46335ab5d - main - linuxkpi: chase spinlock_t in DECLARE_WAIT_QUEUE_HEAD

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Wed, 28 Aug 2024 07:31:10 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=84f46335ab5da086c74032579799c0a74aa27447

commit 84f46335ab5da086c74032579799c0a74aa27447
Author:     Evgenii Khramtsov <2khramtsov@gmail.com>
AuthorDate: 2024-08-27 11:21:39 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2024-08-28 07:29:40 +0000

    linuxkpi: chase spinlock_t in DECLARE_WAIT_QUEUE_HEAD
    
    Remove member m to unbreak consumers, e.g. drm-kmod 5.10-lts branch.
    
    [...]
    /tmp/drm-kmod/drivers/gpu/drm/ttm/ttm_module.c:38:8: error: no member named 'm' in 'struct mtx'
       38 | static DECLARE_WAIT_QUEUE_HEAD(exit_q);
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /tmp/src/sys/compat/linuxkpi/common/include/linux/wait.h:113:33: note: expanded from macro 'DECLARE_WAIT_QUEUE_HEAD'
      113 |         MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF)
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /tmp/src/sys/sys/mutex.h:528:4: note: expanded from macro 'MTX_SYSINIT'
      528 |                 (mtx),                                                  \
          |                  ^~~
    /tmp/drm-kmod/drivers/gpu/drm/ttm/ttm_module.c:38:8: error: no member named 'm' in 'struct mtx'
       38 | static DECLARE_WAIT_QUEUE_HEAD(exit_q);
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /tmp/src/sys/compat/linuxkpi/common/include/linux/wait.h:113:33: note: expanded from macro 'DECLARE_WAIT_QUEUE_HEAD'
      113 |         MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF)
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    [...]
    
    Fixes:          ae38a1a1bfdf ("linuxkpi: spinlock: Simplify code")
    MFC after:      ?
---
 sys/compat/linuxkpi/common/include/linux/wait.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h
index b815050b6faa..309c7816aa7b 100644
--- a/sys/compat/linuxkpi/common/include/linux/wait.h
+++ b/sys/compat/linuxkpi/common/include/linux/wait.h
@@ -110,7 +110,7 @@ extern wait_queue_func_t default_wake_function;
 	wait_queue_head_t name = {					\
 		.task_list = LINUX_LIST_HEAD_INIT(name.task_list),	\
 	};								\
-	MTX_SYSINIT(name, &(name).lock.m, spin_lock_name("wqhead"), MTX_DEF)
+	MTX_SYSINIT(name, &(name).lock, spin_lock_name("wqhead"), MTX_DEF)
 
 #define	init_waitqueue_head(wqh) do {					\
 	mtx_init(&(wqh)->lock, spin_lock_name("wqhead"),		\