fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27773 )
Change subject: osmo-bts-trx: amr_loop: simplify trx_loop_amr_set() ......................................................................
osmo-bts-trx: amr_loop: simplify trx_loop_amr_set()
Change-Id: Ibeed00ef48450edfe1e0d4e179fb4c777b11beb9 Related: SYS#5917, OS#4984 --- M src/osmo-bts-trx/amr_loop.c 1 file changed, 4 insertions(+), 9 deletions(-)
Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/osmo-bts-trx/amr_loop.c b/src/osmo-bts-trx/amr_loop.c index d6e6aac..e5c7fec 100644 --- a/src/osmo-bts-trx/amr_loop.c +++ b/src/osmo-bts-trx/amr_loop.c @@ -99,18 +99,13 @@
void trx_loop_amr_set(struct l1sched_chan_state *chan_state, int loop) { - if (chan_state->amr_loop && !loop) { - chan_state->amr_loop = 0; + if (chan_state->amr_loop == loop) return; - } - - if (!chan_state->amr_loop && loop) { - chan_state->amr_loop = 1; - + if (!chan_state->amr_loop) { /* reset bit errors */ chan_state->ber_num = 0; chan_state->ber_sum = 0; - - return; } + + chan_state->amr_loop = loop; }