<p style="white-space: pre-wrap; word-wrap: break-word;">Found one side effect functional change, and got some style nitpicks</p><p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/15408">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/15408/1/src/osmo-bsc/bsc_subscr_conn_fsm.c">File src/osmo-bsc/bsc_subscr_conn_fsm.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/15408/1/src/osmo-bsc/bsc_subscr_conn_fsm.c@343">Patch Set #1, Line 343:</a> <code style="font-family:monospace,monospace">              if (conn->lchan) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(would prefer the early-exit style; main flow remains undiffed)</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">    if (!conn->lchan) {<br>             log...<br>             state_chg...<br>             clear...<br>             break;<br>    }<br>    <br>    conn_fsm_state_chg(ST_ACTIVE);</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15408/1/src/osmo-bsc/bsc_subscr_conn_fsm.c@671">Patch Set #1, Line 671:</a> <code style="font-family:monospace,monospace">   if (!conn->lchan && gscon_is_active(conn)) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Before, when we already were in the ST_CLEARING, we would still re-send the BSSMAP Clear Request again. I am not sure if that is desired, but if that needs to change, that should be a separate patch.<br>It is fine for the BSC to send repeated Clear Requests, they are only polite hints for the MSC.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Code design wise, it's not such a good idea to have gscon_is_active() listing all *other* states. If a new state gets added in the future, the author is almost guaranteed to forget to also change that function.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Instead I would prefer to more explicitly except only this situation, e.g.:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">    /* If the conn has no lchan anymore, it was released by the BTS and needs to Clear towards MSC. */<br>    if (!conn->lchan) {<br>            switch (conn->fi_state) {<br>            case ST_INIT:<br>            case ST_WAIT_CC:<br>                    /* The SCCP connection was not yet confirmed by a CC, the BSSAP is not fully established<br>                     * yet. First wait for the CC, and release in gscon_fsm_wait_cc(). */<br>                    break;</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">            default:<br>                    /* Ensure that the FSM is in ST_CLEARING. */<br>                    osmo_fsm_inst_state_chg(...ST_CLEARING...)<br>                    /* fall thru, omit an error log if already in ST_CLEARING */<br>            case ST_CLEARING:<br>                    /* Request a Clear Command from the MSC.<br>                    gscon_bssmap_clear([no diff]<br>                    break;<br>            }<br>    }<br> <br>Are you sure that ST_INIT should also be in that condition?</pre></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/15408">change 15408</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/+/15408"/><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: Id1abf5ee44c60925b478123409f26bd29006202b </div>
<div style="display:none"> Gerrit-Change-Number: 15408 </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: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 16 Sep 2019 15:51:35 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>