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 --- src/rate_ctr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rate_ctr.c') diff --git a/src/rate_ctr.c b/src/rate_ctr.c index f995f3fd..3ccd065f 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -147,7 +147,7 @@ static void rate_ctr_timer_cb(void *data) int rate_ctr_init(void *tall_ctx) { tall_rate_ctr_ctx = tall_ctx; - rate_ctr_timer.cb = rate_ctr_timer_cb; + osmo_timer_setup(&rate_ctr_timer, rate_ctr_timer_cb, NULL); osmo_timer_schedule(&rate_ctr_timer, 1, 0); return 0; -- cgit v1.2.3