daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34257 )


Change subject: osmo_io: Use local variable to reference msghdr->msg
......................................................................

osmo_io: Use local variable to reference msghdr->msg

Change-Id: I336ef7a5460dd18bf8e0f4ac5e97747f9fec5a35
---
M src/core/osmo_io_uring.c
1 file changed, 17 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/34257/1

diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c
index 84b7b4c..a6395fe 100644
--- a/src/core/osmo_io_uring.c
+++ b/src/core/osmo_io_uring.c
@@ -182,6 +182,7 @@
 static void iofd_uring_handle_tx(struct iofd_msghdr *msghdr, int rc)
 {
        struct osmo_io_fd *iofd = msghdr->iofd;
+       struct msgb *msg = msghdr->msg;

        if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED))
                goto out_free;
@@ -189,27 +190,27 @@
        /* Error during write */
        if (rc < 0) {
                if (msghdr->action == IOFD_ACT_WRITE)
-                       iofd->io_ops.write_cb(iofd, rc, msghdr->msg);
+                       iofd->io_ops.write_cb(iofd, rc, msg);
                else if (msghdr->action == IOFD_ACT_SENDTO)
-                       iofd->io_ops.sendto_cb(iofd, rc, msghdr->msg, 
&msghdr->osa);
+                       iofd->io_ops.sendto_cb(iofd, rc, msg, &msghdr->osa);
                else
                        OSMO_ASSERT(0);
                goto out_free;
        }

        /* Incomplete write */
-       if (rc < msgb_length(msghdr->msg)) {
+       if (rc < msgb_length(msg)) {
                /* Re-enqueue remaining data */
-               msgb_pull(msghdr->msg, rc);
-               msghdr->iov[0].iov_len = msgb_length(msghdr->msg);
+               msgb_pull(msg, rc);
+               msghdr->iov[0].iov_len = msgb_length(msg);
                iofd_txqueue_enqueue_front(iofd, msghdr);
                goto out;
        }

        if (msghdr->action == IOFD_ACT_WRITE)
-               iofd->io_ops.write_cb(iofd, rc, msghdr->msg);
+               iofd->io_ops.write_cb(iofd, rc, msg);
        else if (msghdr->action == IOFD_ACT_SENDTO)
-               iofd->io_ops.sendto_cb(iofd, rc, msghdr->msg, &msghdr->osa);
+               iofd->io_ops.sendto_cb(iofd, rc, msg, &msghdr->osa);
        else
                OSMO_ASSERT(0);


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34257
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I336ef7a5460dd18bf8e0f4ac5e97747f9fec5a35
Gerrit-Change-Number: 34257
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <[email protected]>
Gerrit-MessageType: newchange

Reply via email to