git: 9d18e2c12629 - main - LinuxKPI: remove timer KPI from Linux version before 4.15

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 17 Sep 2026 21:16:46 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d18e2c12629eba4229564a17c1fa3adf15bb5ac

commit 9d18e2c12629eba4229564a17c1fa3adf15bb5ac
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-09-15 00:32:33 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-09-17 21:16:17 +0000

    LinuxKPI: remove timer KPI from Linux version before 4.15
    
    Now that semi-native drivers in main are clean of using any
    pre-4.15 Linux timer KPI, remove the macros from LinuxKPI as well.
    
    Supported versions of drm-kmod and the oldest nvidia port seem fine
    based on my checks.  If anything else surfaces we can deal with the
    fallout; the changes to the newer KPI were mechanical in Linux and
    can be applied easily.
    
    This change can be detected by #if !defined(init_timer)
    at compile time so no need for a __FreeBSD_version bump.
    
    MFC after:      3 days
    Reviewed by:    emaste
    Differential Revision: https://reviews.freebsd.org/D59688
---
 sys/compat/linuxkpi/common/include/linux/timer.h | 26 ++----------------------
 sys/compat/linuxkpi/common/src/linux_compat.c    |  2 +-
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h
index d48939e28a02..83b308c81b67 100644
--- a/sys/compat/linuxkpi/common/include/linux/timer.h
+++ b/sys/compat/linuxkpi/common/include/linux/timer.h
@@ -37,11 +37,7 @@
 
 struct timer_list {
 	struct callout callout;
-	union {
-		void (*function) (unsigned long);	/* < v4.15 */
-		void (*function_415) (struct timer_list *);
-	};
-	unsigned long data;
+	void (*function) (struct timer_list *);
 	unsigned long expires;
 };
 
@@ -59,26 +55,8 @@ extern unsigned long linux_timer_hz_mask;
 
 #define	timer_setup(timer, func, flags) do {				\
 	CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0);			\
-	(timer)->function_415 = (func);					\
-	(timer)->data = (unsigned long)(timer);				\
-	callout_init(&(timer)->callout, 1);				\
-} while (0)
-
-#define	setup_timer(timer, func, dat) do {				\
 	(timer)->function = (func);					\
-	(timer)->data = (dat);						\
-	callout_init(&(timer)->callout, 1);			\
-} while (0)
-
-#define	__setup_timer(timer, func, dat, flags) do {			\
-	CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0);			\
-	setup_timer(timer, func, dat);					\
-} while (0)
-
-#define	init_timer(timer) do {						\
-	(timer)->function = NULL;					\
-	(timer)->data = 0;						\
-	callout_init(&(timer)->callout, 1);			\
+	callout_init(&(timer)->callout, 1);				\
 } while (0)
 
 extern int mod_timer(struct timer_list *, unsigned long);
diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
index 84f95b3ec317..24655eb0341d 100644
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -2147,7 +2147,7 @@ linux_timer_callback_wrapper(void *context)
 		return;
 	}
 
-	timer->function(timer->data);
+	timer->function(timer);
 }
 
 static int