[PATCH] libosmo-abis[master]: cosmetic: ipa.c: use msgb_dequeue(), drop local var

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Sep 14 03:01:35 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3942

to look at the new patch set (#2).

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
---
M src/input/ipa.c
1 file changed, 3 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/42/3942/2

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

-- 
To view, visit https://gerrit.osmocom.org/3942
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id968e60d081a6d69de482a908ca3fe5e1044aaa3
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list