aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-09-09 10:01:48 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-09 15:40:58 +0000
commit386c33fa847d9f00937c43005bf6f949536cffbb (patch)
tree5d38e12e25c390b0f8995a2d04a47c6a54a2adc5
parentd9a1cd994ced629589fbf75bc59490c5fc0d1a43 (diff)
CBCH: Use llist_first_entry_or_null() instead of reinventing it
-rw-r--r--src/common/cbch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/cbch.c b/src/common/cbch.c
index b8f69c6..56d76f1 100644
--- a/src/common/cbch.c
+++ b/src/common/cbch.c
@@ -144,12 +144,10 @@ static struct smscb_msg *select_next_smscb(struct gsm_bts *bts)
{
struct smscb_msg *msg;
- if (llist_empty(&bts->smscb_state.queue))
+ msg = llist_first_entry_or_null(&bts->smscb_state.queue, struct smscb_msg, list);
+ if (!msg)
return NULL;
- msg = llist_entry(bts->smscb_state.queue.next,
- struct smscb_msg, list);
-
llist_del(&msg->list);
return msg;