aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-09-14 04:32:19 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-09-14 04:59:32 +0200
commit01543a1ea392fa98974ea2f99cafbc28e9966656 (patch)
tree3cca99120b5634294116138d28e75ccc0e651dfa
parentd3292913ac99b4a57094ca19fd70571ec6914f48 (diff)
cosmetic: ipa.c: use msgb_dequeue(), drop local var
Make ipa_server_conn_write() a lot simpler and shorter by using msgb_dequeue() and avoiding local pointer that was used only once. Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3
-rw-r--r--src/input/ipa.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/input/ipa.c b/src/input/ipa.c
index ce155ce..fbed038 100644
--- a/src/input/ipa.c
+++ b/src/input/ipa.c
@@ -358,20 +358,16 @@ static void ipa_server_conn_read(struct ipa_server_conn *conn)
static void ipa_server_conn_write(struct ipa_server_conn *conn)
{
- struct osmo_fd *ofd = &conn->ofd;
struct msgb *msg;
- struct llist_head *lh;
int ret;
LOGP(DLINP, LOGL_DEBUG, "sending data\n");
+ msg = msgb_dequeue(&conn->tx_queue);
- if (llist_empty(&conn->tx_queue)) {
- ofd->when &= ~BSC_FD_WRITE;
+ if (!msg) {
+ conn->ofd.when &= ~BSC_FD_WRITE;
return;
}
- lh = conn->tx_queue.next;
- llist_del(lh);
- msg = llist_entry(lh, struct msgb, list);
ret = send(conn->ofd.fd, msg->data, msg->len, 0);
if (ret < 0) {