Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 May 2026 19:27:48 +0000
From:      Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron <dumbbell@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 658bb99db9c7 - main - linuxkpi: Implement `module_*()` APIs as static functions
Message-ID:  <69f8f334.3e3a4.d717d55@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by dumbbell:

URL: https://cgit.FreeBSD.org/src/commit/?id=658bb99db9c7872f92ccb86ed2674c72636436d2

commit 658bb99db9c7872f92ccb86ed2674c72636436d2
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-05-04 07:45:38 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-05-04 19:13:43 +0000

    linuxkpi: Implement `module_*()` APIs as static functions
    
    This fixes an "unused variable" warning when building DRM drivers.
    
    Reviewed by:    emaste
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D56780
---
 sys/compat/linuxkpi/common/include/linux/module.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/module.h b/sys/compat/linuxkpi/common/include/linux/module.h
index fbe57cbbed82..de4be1e9ebe9 100644
--- a/sys/compat/linuxkpi/common/include/linux/module.h
+++ b/sys/compat/linuxkpi/common/include/linux/module.h
@@ -136,9 +136,14 @@ _module_run(void *arg)
 #define	module_exit_order(fn, order)				\
 	SYSUNINIT(fn, SI_SUB_OFED_MODINIT, (order), _module_run, (fn))
 
-#define	module_get(module)
-#define	module_put(module)
-#define	try_module_get(module)	1
+static inline void module_get(struct module *module) {}
+static inline void module_put(struct module *module) {}
+
+static inline bool
+try_module_get(struct module *module)
+{
+	return (true);
+}
 
 #define	postcore_initcall(fn)	module_init(fn)
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f8f334.3e3a4.d717d55>