aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-01-11 00:42:46 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-01-21 01:18:02 +0100
commit30ffa7ade5aa55e95cf888bbdd9028f2983d663c (patch)
tree5d3d61e238e7d8cf510285e04170e0de2592fddb
parentc9fa25e8316b8af3e9f11b9e79368092df466972 (diff)
undup: subchan_demux.c: use libosmocore's llist_count()
-rw-r--r--src/subchan_demux.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/subchan_demux.c b/src/subchan_demux.c
index f965490..238056c 100644
--- a/src/subchan_demux.c
+++ b/src/subchan_demux.c
@@ -289,17 +289,6 @@ int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len)
return i;
}
-static int llist_len(struct llist_head *head)
-{
- struct llist_head *entry;
- int i = 0;
-
- llist_for_each(entry, head)
- i++;
-
- return i;
-}
-
/* evict the 'num_evict' number of oldest entries in the queue */
static void tx_queue_evict(struct mux_subch *sch, int num_evict)
{
@@ -327,7 +316,7 @@ int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
int len)
{
struct mux_subch *sch = &mx->subch[s_nr];
- int list_len = llist_len(&sch->tx_queue);
+ unsigned int list_len = llist_count(&sch->tx_queue);
struct subch_txq_entry *tqe = talloc_zero_size(tall_tqe_ctx,
sizeof(*tqe) + len);
if (!tqe)