<p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/14768">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/14768/1/src/osmo-bsc/neighbor_ident_vty.c">File src/osmo-bsc/neighbor_ident_vty.c:</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/14768/1/src/osmo-bsc/neighbor_ident_vty.c@416">Patch Set #1, Line 416:</a> <code style="font-family:monospace,monospace">           rc = gsm_bts_local_neighbor_del(bts, neigh_bts);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I feel more comfortable with the while(), but if two reviewers insist, I can change it to llist_for_each_entry_safe().</p><p style="white-space: pre-wrap; word-wrap: break-word;">Reasoning:</p><p style="white-space: pre-wrap; word-wrap: break-word;">I am pretty sure that each neighbor is listed only once, and always will. But assuming that implementations change, and that for some weird reason a neighbor could end up listed twice, then this gsm_bts_local_neighbor_del() should semantically remove more than one item from the list. llist_for_each_entry_safe() is only safe as long as one item gets deleted. That's why I feel more comfortable with a while() loop that always goes back to the start.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I pretty much know that this situation does not apply for this particular list and it's unlikely to ever change so that this applies. But still the while() comes from a general mistrust of llist_for_each_entry_safe() where it is not directly and trivially clear for all eternity that at most one item will be removed per iteration. Here the llist_del() is hidden in another function which might change in implementation ... (not actually, but feels safer to assume that it might)</p><p style="white-space: pre-wrap; word-wrap: break-word;">...that's my bikeshed reason to not change this</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/14768">change 14768</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/+/14768"/><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: I8623ab581639e9f8af6a9ff1eca990518d1b1211 </div>
<div style="display:none"> Gerrit-Change-Number: 14768 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </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: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 30 Jul 2019 15:28:21 +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>