<p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24372">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-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h">File include/osmocom/bsc/gsm_data.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-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h@567">Patch Set #3, Line 567:</a> <code style="font-family:monospace,monospace">      ((lchan - (ts)->lchan) < ARRAY_SIZE((ts)->lchan)) \</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Are you sure this is correct? AFAIR (lchan - (ts)->lchan) is a pointer distance in bytes, not in ele […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">you *always* get a distance in pointer-type-sizeof. A distance in bytes will only be returned for e.g. uint8_t*. For gsm_lchan* you always get a distance in array indexes. I and we and everyone is using that all over the place and I am absolutely positively sure.</p><p style="white-space: pre-wrap; word-wrap: break-word;">x = &lchan[3] <br>is identical to<br>x = lchan + 3</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h@568">Patch Set #3, Line 568:</a> <code style="font-family:monospace,monospace">      && lchan->fi \</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">So if  an lchan has no fi, you early exit the loop? does that make sense? you should simply skip tha […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd like that, but we can't skip in a for loop macro like this : (</p><p style="white-space: pre-wrap; word-wrap: break-word;">And actually there will never be a "fi gap" in the lchan array.<br>As soon as one NULL fi is encountered, the rest of them will also be NULL.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h@569">Patch Set #3, Line 569:</a> <code style="font-family:monospace,monospace">      && ((lchan - (ts)->lchan) < (N)); \</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Same here, I'd say that's a distance in bytes, not in elements.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">didn't expect this from you Pau ; )  ; )  ; )</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24372">change 24372</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-bsc/+/24372"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib2c6baf73a81ba371143ba5adc912aef6f79238d </div>
<div style="display:none"> Gerrit-Change-Number: 24372 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@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: Tue, 25 May 2021 15:17:01 +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>