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
This commit is contained in:
Neels Hofmeyr 2017-09-14 04:32:19 +02:00
parent d3292913ac
commit 01543a1ea3
1 changed files with 3 additions and 7 deletions

View File

@ -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) {