Change in osmo-pcu[master]: pdch: has_gprs_only_tb_attached: use m_num_tbfs

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

pespin gerrit-no-reply at lists.osmocom.org
Tue Sep 21 10:28:52 UTC 2021


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

Change subject: pdch: has_gprs_only_tb_attached: use m_num_tbfs
......................................................................

pdch: has_gprs_only_tb_attached: use m_num_tbfs

Make use of the separate GPRS counters added in previous patch
I0c0a1121b4ae5f031782e7e63a0c28eb0b6c8b42 to shorten
has_gprs_only_tb_attached.

Related: SYS#4878
Change-Id: I1dd7df2c740ea604f07c65bebcb7c0051aebf9ae
---
M src/pdch.cpp
1 file changed, 2 insertions(+), 12 deletions(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/pdch.cpp b/src/pdch.cpp
index d10ee4a..19d57a2 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -1114,18 +1114,8 @@
 
 bool gprs_rlcmac_pdch::has_gprs_only_tbf_attached() const
 {
-	unsigned int i;
-	unsigned int j;
-	for (i = 0; i < sizeof(m_assigned_tfi[0]); i++) {
-		for (j = 0; j < 2; j++) {
-			if (m_assigned_tfi[j] & (1UL << i)) {
-				gprs_rlcmac_tbf *tbf = m_tbfs[j][i];
-				if (!tbf->is_egprs_enabled())
-					return true;
-			}
-		}
-	}
-	return false;
+	return (m_num_tbfs_gprs[GPRS_RLCMAC_UL_TBF] +
+		m_num_tbfs_gprs[GPRS_RLCMAC_DL_TBF]) > 0;
 }
 
 void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/25401
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I1dd7df2c740ea604f07c65bebcb7c0051aebf9ae
Gerrit-Change-Number: 25401
Gerrit-PatchSet: 11
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210921/d50e70e7/attachment.htm>


More information about the gerrit-log mailing list