From 8baf32af6987d27278dbc0e65f56baef8079d92c Mon Sep 17 00:00:00 2001 From: Tatsunosuke Tobita Date: Thu, 6 Nov 2025 09:31:35 +0900 Subject: [PATCH 1/3] treewide, timers: Rename from_timer() to timer_container_of() Move this API to the canonical timer_*() namespace. [ tglx: Redone against pre rc1 ] Signed-off-by: Ingo Molnar mingo@kernel.org Signed-off-by: Thomas Gleixner tglx@linutronix.de Link: https://lore.kernel.org/all/aB2X0jCKQO56WdMt@gmail.com --- 4.18/wacom_wac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/4.18/wacom_wac.c b/4.18/wacom_wac.c index 0e05529b..e672dc12 100644 --- a/4.18/wacom_wac.c +++ b/4.18/wacom_wac.c @@ -75,7 +75,11 @@ static void wacom_force_proxout(struct wacom_wac *wacom_wac) void wacom_idleprox_timeout(struct timer_list *list) { +#ifdef WACOM_TIMER_ADDR_CONTAINER_RENAME + struct wacom *wacom = timer_container_of(wacom, list, idleprox_timer); +#else struct wacom *wacom = from_timer(wacom, list, idleprox_timer); +#endif struct wacom_wac *wacom_wac = &wacom->wacom_wac; if (!wacom_wac->hid_data.sense_state) { From c9e67d2b93ccb43c0f58bf1674dee602efe41d7e Mon Sep 17 00:00:00 2001 From: Tatsunosuke Tobita Date: Thu, 6 Nov 2025 09:40:40 +0900 Subject: [PATCH 2/3] configure.ac: add a check if timer_container_of exists From the kernel version 6.16, timer_container_of is used instead of from_timer. To check whether or not it is available, another AC_MSG_CHECKING block has been added. Signed-off-by: Tatsunosuke Tobita tatsunosuke.tobita@wacom.com --- configure.ac | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 34856953..7f4d2174 100644 --- a/configure.ac +++ b/configure.ac @@ -303,7 +303,21 @@ bool timer_delete_sync(struct timer_list *timer) { return true; } AC_DEFINE([WACOM_TIMER_DELETE_SYNC], [], [kernel defines timer_delete_sync from v6.1.84+]) ]) - +dnl Check if from_timer has been renamed to timer_container_of or +dnl not. This is the case in Linux 6.16 and later. +AC_MSG_CHECKING(timer_container_of) +WACOM_LINUX_TRY_COMPILE([ +#include +bool timer_container_of() { return true; } +],[ +],[ + HAVE_TIMER_CONTAINER_OF=no + AC_MSG_RESULT([no]) +],[ + HAVE_TIMER_CONTAINER_OF=yes + AC_MSG_RESULT([yes]) + AC_DEFINE([WACOM_TIMER_ADDR_CONTAINER_RENAME], [], [kernel defines timer_container_of from v6.16]) +]) dnl Check which version of the driver we should compile AC_DEFUN([WCM_EXPLODE], [$(echo "$1" | awk '{split($[0],x,"[[^0-9]]"); printf("%03d%03d%03d\n",x[[1]],x[[2]],x[[3]]);}')]) From 31a79d1f54bfc4381fd17abbd99eeb128e2e2dc4 Mon Sep 17 00:00:00 2001 From: Tatsunosuke Tobita Date: Thu, 6 Nov 2025 10:25:58 +0900 Subject: [PATCH 3/3] Add files via upload configure.ac: modify timer_container_of check Since timer_container_of is defined as a macro, the checking process has been modified. Signed-off-by: Tatsunosuke Tobita --- configure.ac | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 7f4d2174..ece64c45 100644 --- a/configure.ac +++ b/configure.ac @@ -308,15 +308,17 @@ dnl not. This is the case in Linux 6.16 and later. AC_MSG_CHECKING(timer_container_of) WACOM_LINUX_TRY_COMPILE([ #include -bool timer_container_of() { return true; } +#ifndef timer_container_of +#error "timer_container_of is not defined" +#endif ],[ -],[ - HAVE_TIMER_CONTAINER_OF=no - AC_MSG_RESULT([no]) ],[ HAVE_TIMER_CONTAINER_OF=yes AC_MSG_RESULT([yes]) AC_DEFINE([WACOM_TIMER_ADDR_CONTAINER_RENAME], [], [kernel defines timer_container_of from v6.16]) +],[ + HAVE_TIMER_CONTAINER_OF=no + AC_MSG_RESULT([no]) ]) dnl Check which version of the driver we should compile