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/gsm/gsm0411_smr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gsm/gsm0411_smr.c') diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index a1ee9804..6d7fb8b5 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -77,8 +77,7 @@ void gsm411_smr_init(struct gsm411_smr_inst *inst, uint64_t id, int network, inst->rp_state = GSM411_RPS_IDLE; inst->rl_recv = rl_recv; inst->mn_send = mn_send; - inst->rp_timer.data = inst; - inst->rp_timer.cb = rp_timer_expired; + osmo_timer_setup(&inst->rp_timer, rp_timer_expired, inst); LOGP(DLSMS, LOGL_INFO, SMR_LOG_STR "instance created for %s.\n", -- cgit v1.2.3