[MERGED] libosmocore[master]: msgb: msgb_get: Drop unneeded tmp 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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Apr 11 21:26:14 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: msgb: msgb_get: Drop unneeded tmp var
......................................................................


msgb: msgb_get: Drop unneeded tmp var

Change-Id: I27bb2ab59408c9cd1363b3b5acb2263128c55732
---
M include/osmocom/core/msgb.h
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 374ddbe..a983195 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -230,13 +230,12 @@
  */
 static inline unsigned char *msgb_get(struct msgb *msgb, unsigned int len)
 {
-	unsigned char *tmp = msgb->tail - len;
 	if (msgb_length(msgb) < len)
 		MSGB_ABORT(msgb, "msgb too small to get %u (len %u)\n",
 			   len, msgb_length(msgb));
 	msgb->tail -= len;
 	msgb->len -= len;
-	return tmp;
+	return msgb->tail;
 }
 
 /*! remove uint8 from end of message

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I27bb2ab59408c9cd1363b3b5acb2263128c55732
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list