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_bssgp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gb/gprs_bssgp.c') diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index dba4d5ca..fdbf7884 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -640,8 +640,7 @@ static int fc_queue_timer_cfg(struct bssgp_flow_control *fc) msecs = (fcqe->llc_pdu_len * 1000) / fc->bucket_leak_rate; /* FIXME: add that time to fc->time_last_pdu and subtract it from * current time */ - fc->timer.data = fc; - fc->timer.cb = &fc_timer_cb; + osmo_timer_setup(&fc->timer, fc_timer_cb, fc); osmo_timer_schedule(&fc->timer, msecs / 1000, (msecs % 1000) * 1000); } else { /* If the PCU is telling us to not send any more data at all, -- cgit v1.2.3