neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14768 )

Change subject: add vty 'no neighbors' to remove all HO targets
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/14768/1/src/osmo-bsc/neighbor_ident_vty.c
File src/osmo-bsc/neighbor_ident_vty.c:

https://gerrit.osmocom.org/#/c/14768/1/src/osmo-bsc/neighbor_ident_vty.c@416
PS1, Line 416:          rc = gsm_bts_local_neighbor_del(bts, neigh_bts);
I feel more comfortable with the while(), but if two reviewers insist, I can 
change it to llist_for_each_entry_safe().

Reasoning:

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.

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)

...that's my bikeshed reason to not change this



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8623ab581639e9f8af6a9ff1eca990518d1b1211
Gerrit-Change-Number: 14768
Gerrit-PatchSet: 2
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <[email protected]>
Gerrit-CC: laforge <[email protected]>
Gerrit-Comment-Date: Tue, 30 Jul 2019 15:28:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to