[PATCH 02/14] compat: timer.h: Remove last parameters from DEFINE_TIMER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


DEFINE_TIMER only has 2 parameters since kernel commit 1d27e3e2252ba
("timer: Remove expires and data arguments from DEFINE_TIMER") which was
added with kernel 4.15. Add a version which translates between the new
and the old API.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
 backport/backport-include/linux/timer.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/linux/timer.h b/backport/backport-include/linux/timer.h
index 9824ea6b..69590bb7 100644
--- a/backport/backport-include/linux/timer.h
+++ b/backport/backport-include/linux/timer.h
@@ -60,4 +60,11 @@ static inline void timer_setup(struct timer_list *timer,
 	container_of(callback_timer, typeof(*var), timer_fieldname)
+#define DEFINE_TIMER(_name, _function)				\
+	struct timer_list _name =				\
+		__TIMER_INITIALIZER(_function, 0, 0, 0)
 #endif /* _BACKPORT_TIMER_H */

To unsubscribe from this list: send the line "unsubscribe backports" in

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux