laforge has submitted this change. ( 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(-)
Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
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);