fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email )


Change subject: mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul()
......................................................................

mgcp: simplify getting msgb tail in mgcp_msg_terminate_nul()

The current statement:

  msg->l2h + msgb_l2len(msg)

looks as follows, if we expand the msgb_l2len():

  msg->l2h + msgb->tail - msg->l2h

so this is basically equal to msgb->tail alone.

Change-Id: I4f4b0f792bbeef94a5449c4a5843628a703a3d54
Related: CID#272990
---
M include/osmocom/mgcp/mgcp_common.h
1 file changed, 21 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/21/35321/1

diff --git a/include/osmocom/mgcp/mgcp_common.h 
b/include/osmocom/mgcp/mgcp_common.h
index 7de45f9..be5a0d6 100644
--- a/include/osmocom/mgcp/mgcp_common.h
+++ b/include/osmocom/mgcp/mgcp_common.h
@@ -68,7 +68,7 @@
 /* Ensure that the msg->l2h is NUL terminated. */
 static inline int mgcp_msg_terminate_nul(struct msgb *msg)
 {
-       unsigned char *tail = msg->l2h + msgb_l2len(msg); /* char after l2 data 
*/
+       unsigned char *tail = msg->tail; /* char after l2 data */
        if (tail[-1] == '\0')
                /* nothing to do */;
        else if (msgb_tailroom(msg) > 0)

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35321?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I4f4b0f792bbeef94a5449c4a5843628a703a3d54
Gerrit-Change-Number: 35321
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to