[MERGED] osmo-pcu[master]: tbf: replace this == NULL check in tbf->name

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/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Fri Jun 10 11:14:10 UTC 2016


Holger Freyther has submitted this change and it was merged.

Change subject: tbf: replace this == NULL check in tbf->name
......................................................................


tbf: replace this == NULL check in tbf->name

All checks of (this == null) will be eliminated by GCC >= 6.1
(https://gcc.gnu.org/gcc-6/changes.html, Value range propagation now
assumes that the this pointer of C++ member functions is non-null.

Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b
Reviewed-on: https://gerrit.osmocom.org/136
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge at gnumonks.org>
Reviewed-by: Holger Freyther <holger at freyther.de>
---
M src/tbf.cpp
1 file changed, 1 insertion(+), 4 deletions(-)

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



diff --git a/src/tbf.cpp b/src/tbf.cpp
index 69b9e3a..1fc1aef 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -1176,14 +1176,11 @@
 
 const char *tbf_name(gprs_rlcmac_tbf *tbf)
 {
-	return tbf->name();
+	return tbf ? tbf->name() : "(no TBF)";
 }
 
 const char *gprs_rlcmac_tbf::name() const
 {
-	if (this == NULL)
-		return "(no TBF)";
-
 	snprintf(m_name_buf, sizeof(m_name_buf) - 1,
 		"TBF(TFI=%d TLLI=0x%08x DIR=%s STATE=%s%s)",
 		m_tfi, tlli(),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b
Gerrit-PatchSet: 3
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>



More information about the gerrit-log mailing list