pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/29548 )

Change subject: hnb_read_cb: use local var to reduce get_ofd() calls
......................................................................

hnb_read_cb: use local var to reduce get_ofd() calls

Change-Id: Ic7058b5a05b0d34b80617006d4e929a523212221
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve



diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index dd0999c..b824dd3 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -239,6 +239,7 @@
 static int hnb_read_cb(struct osmo_stream_srv *conn)
 {
        struct hnb_context *hnb = osmo_stream_srv_get_data(conn);
+       struct osmo_fd *ofd = osmo_stream_srv_get_ofd(conn);
        struct msgb *msg = msgb_alloc(IUH_MSGB_SIZE, "Iuh rx");
        int rc;

@@ -261,7 +262,7 @@
                        case SCTP_COMM_LOST:
                                LOGHNB(hnb, DMAIN, LOGL_NOTICE,
                                       "sctp_recvmsg(%s) = SCTP_COMM_LOST, 
closing conn\n",
-                                      
osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                                      osmo_sock_get_name2(ofd->fd));
                                osmo_stream_srv_destroy(conn);
                                rc = -1;
                                break;
@@ -274,7 +275,7 @@
                case SCTP_SHUTDOWN_EVENT:
                        LOGHNB(hnb, DMAIN, LOGL_NOTICE,
                               "sctp_recvmsg(%s) = SCTP_SHUTDOWN_EVENT, closing 
conn\n",
-                              
osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                              osmo_sock_get_name2(ofd->fd));
                        osmo_stream_srv_destroy(conn);
                        rc = -1;
                        break;
@@ -288,12 +289,12 @@
                goto out;
        } else if (rc < 0) {
                LOGHNB(hnb, DMAIN, LOGL_ERROR, "Error during 
sctp_recvmsg(%s)\n",
-                      osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                      osmo_sock_get_name2(ofd->fd));
                osmo_stream_srv_destroy(conn);
                goto out;
        } else if (rc == 0) {
                LOGHNB(hnb, DMAIN, LOGL_NOTICE, "Connection closed 
sctp_recvmsg(%s) = 0\n",
-                      osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                      osmo_sock_get_name2(ofd->fd));
                osmo_stream_srv_destroy(conn);
                rc = -1;
                goto out;



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29548
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ic7058b5a05b0d34b80617006d4e929a523212221
Gerrit-Change-Number: 29548
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to