<p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22436">View Change</a></p><p>3 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/+/22436/1//COMMIT_MSG">Commit Message:</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/+/22436/1//COMMIT_MSG@19">Patch Set #1, Line 19:</a> <code style="font-family:monospace,monospace">later on priority</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(can you avoid using 'later' twice with different meaning to make it more readable?)</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22436/1/src/gprs_rlcmac_sched.cpp">File src/gprs_rlcmac_sched.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/+/22436/1/src/gprs_rlcmac_sched.cpp@325">Patch Set #1, Line 325:</a> <code style="font-family:monospace,monospace">                  (prio !=DL_PRIO_CONTROL && !(prio == DL_PRIO_NEW_DATA && w->resend_needed() < 0))) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">The if gets very complex.</p><p style="white-space: pre-wrap; word-wrap: break-word;">How about refactoring this into a function instead?</p><p style="white-space: pre-wrap; word-wrap: break-word;">Something like this (if using it, make sure that all the true / false are right, it's just a draft):</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br> bool can_downgrade(tbf, req_msc_kind, prio)<br> {<br>    if (req_msc_kind == ...)<br>              return true;<br>  if (!tbf->is_egprs_enabled())<br>              return true;<br> <br>       switch (prio) {<br>       case DL_PRIO_CONTROL:<br>                 return false;<br>         case DL_PRIO_NEW_DATA:<br>                return w->resend_needed();<br>         }<br>     return false;<br> }</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22436/1/src/gprs_rlcmac_sched.cpp@325">Patch Set #1, Line 325:</a> <code style="font-family:monospace,monospace">=D</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(missing space, fix it while at it?)</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/22436">change 22436</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/+/22436"/><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: I253de8e1a190a9adb56160f38892c9e43e2c0272 </div>
<div style="display:none"> Gerrit-Change-Number: 22436 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 26 Jan 2021 12:40:26 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>