From 44f423f11717367639a12e6b533e293cccf6f6ba Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 8 May 2017 18:00:28 +0200 Subject: timer: add osmo_timer_setup() Add a new function timer function to set up the timer, similar to what we have in the Linux kernel. This patch also converts existing opencoded timer setup in the libosmocore tree as initial client of this new function. This patch implicitly removes function callback passed by reference that defeat compile time type validation. Compile-tested only, but I ran make check that reports success when testing timer infrastructure. Change-Id: I2fa49972ecaab3748b25168b26d92034e9145666 --- include/osmocom/core/timer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/osmocom/core') diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index dbda13f2..48e7d8da 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -65,6 +65,8 @@ struct osmo_timer_list { * timer management */ +void osmo_timer_setup(struct osmo_timer_list *timer, void (*cb)(void *data), void *data); + void osmo_timer_add(struct osmo_timer_list *timer); void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds); -- cgit v1.2.3