File: 1190-timer_setup.patch

package info (click to toggle)
osmocom-dahdi-linux 0.0~git20250226.6dada77-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,068 kB
  • sloc: ansic: 116,364; perl: 2,391; sh: 977; makefile: 357
file content (43 lines) | stat: -rw-r--r-- 1,621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Author: Andreas Beckmann <anbe@debian.org>
Description: timer_setup() was introduced in Linux v4.14

Index: osmocom-dahdi-linux-0.0~git20250226.6dada77/include/dahdi/kernel.h
===================================================================
--- osmocom-dahdi-linux-0.0~git20250226.6dada77.orig/include/dahdi/kernel.h	2025-09-13 10:24:28.398194879 +0200
+++ osmocom-dahdi-linux-0.0~git20250226.6dada77/include/dahdi/kernel.h	2025-09-13 10:24:28.394194877 +0200
@@ -1442,7 +1442,16 @@
 #define TIMER_DATA_TYPE unsigned long
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+
+/* timer_setup and friends in 4.14 had a slightly different interface than in 4.15+ */
+#define timer_setup(timer, callback, flags) __setup_timer((timer), (TIMER_FUNC_TYPE)(callback), (TIMER_DATA_TYPE)(timer), (flags))
+#undef from_timer
+#define from_timer(var, callback_timer, timer_fieldname) \
+	container_of((struct timer_list *)(callback_timer), \
+		     typeof(*var), timer_fieldname)
+
+#else
 
 #ifdef RHEL_RELEASE_VERSION
 #if RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7, 5)
@@ -1454,7 +1463,7 @@
 
 #ifndef DAHDI_HAVE_TIMER_SETUP
 /**
- * timer_setup - Added in 4.13.0.  We can make a direct translation to the
+ * timer_setup - Added in 4.14.0.  We can make a direct translation to the
  * setup_timer interface since DAHDI does not pass any flags to any of the
  * timer_setup functions.
  *
@@ -1545,7 +1554,7 @@
 #endif /* 4.0.0 */
 #endif /* 4.10.0 */
 #endif /* 4.11.0 */
-#endif /* 4.13.0 */
+#endif /* 4.14.0 */
 #else /* >= 4.15.0 */
 
 #ifndef TIMER_DATA_TYPE