<p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400">View Change</a></p><p>5 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/pdch.h">File src/pdch.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/pdch.h@81">Patch Set #2, Line 81:</a> <code style="font-family:monospace,monospace">       void num_tbfs_update(gprs_rlcmac_tbf *tbf, enum tbf_type type, bool is_attach);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">type should be known from tbf, no need to pass it?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/pdch.cpp">File src/pdch.cpp:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/pdch.cpp@1065">Patch Set #2, Line 1065:</a> <code style="font-family:monospace,monospace">     enum tbf_type type = tbf->is_egprs_enabled() ? TBF_TYPE_EGPRS : TBF_TYPE_GPRS;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">why aren't you calling tbf->is_egprs_enabled() inside num_tbfs_update()!?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/tbf.h">File src/tbf.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/tbf.h@90">Patch Set #2, Line 90:</a> <code style="font-family:monospace,monospace">  TBF_TYPE_GPRS,</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">No need for this!</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Are you sure? just using 0 and 1 there makes the code harder to read IMHO, e.g.</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> return (m_num_tbfs[GPRS_RLCMAC_UL_TBF][TBF_TYPE_GPRS] + m_num_tbfs[GPRS_RLCMAC_DL_TBF][TBF_TYPE_GPRS]) > 0;</pre><p style="white-space: pre-wrap; word-wrap: break-word;">vs</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> return (m_num_tbfs[GPRS_RLCMAC_UL_TBF][0] + m_num_tbfs[GPRS_RLCMAC_DL_TBF][0]) > 0;</pre><p style="white-space: pre-wrap; word-wrap: break-word;">and</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> return m_num_tbfs[dir][TBF_TYPE_GPRS] + m_num_tbfs[dir][TBF_TYPE_EGPRS];</pre><p style="white-space: pre-wrap; word-wrap: break-word;">vs</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> return m_num_tbfs[dir][0] + m_num_tbfs[dir][1];</pre></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/tbf.cpp">File src/tbf.cpp:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/tbf.cpp@773">Patch Set #2, Line 773:</a> <code style="font-family:monospace,monospace">  for (int ts = 0; ts < 8; ts++) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">what about using ARRAY_SIZE(pdch) here instead of 8?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400/2/src/tbf.cpp@779">Patch Set #2, Line 779:</a> <code style="font-family:monospace,monospace">           if (direction == GPRS_RLCMAC_DL_TBF && pdch[ts]->dl_tbf_by_tfi(m_tfi) != this)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">why are the last 2 if conditions needed? if pdch[ts] it means it's attached right? no need to do thi […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">If I remove the checks, it will run num_tbfs_update on PDCHs where _any_ TBF is attached, instead of only the PDCH where the relevant TBF ("this") is attached.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400">change 25400</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-pcu/+/25400"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0c0a1121b4ae5f031782e7e63a0c28eb0b6c8b42 </div>
<div style="display:none"> Gerrit-Change-Number: 25400 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 17 Sep 2021 08:47:44 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>