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/gb/gprs_ns.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gb/gprs_ns.c') diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 7b497c2e..9a2a114f 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -238,8 +238,7 @@ struct gprs_nsvc *gprs_nsvc_create(struct gprs_ns_inst *nsi, uint16_t nsvci) /* before RESET procedure: BLOCKED and DEAD */ nsvc->state = NSE_S_BLOCKED; nsvc->nsi = nsi; - nsvc->timer.cb = gprs_ns_timer_cb; - nsvc->timer.data = nsvc; + osmo_timer_setup(&nsvc->timer, gprs_ns_timer_cb, nsvc); nsvc->ctrg = rate_ctr_group_alloc(nsvc, &nsvc_ctrg_desc, nsvci); nsvc->statg = osmo_stat_item_group_alloc(nsvc, &nsvc_statg_desc, nsvci); -- cgit v1.2.3