<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/18595">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">abis_nm: cosmetic: add curly braces to complex 'if' statements<br><br>Change-Id: I74fbb46920c74a194c296feeeb1bb086fcbd572f<br>---<br>M src/osmo-bsc/abis_nm.c<br>1 file changed, 10 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/18595/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c</span><br><span>index 4ed0602..a0aead8 100644</span><br><span>--- a/src/osmo-bsc/abis_nm.c</span><br><span>+++ b/src/osmo-bsc/abis_nm.c</span><br><span>@@ -570,25 +570,29 @@</span><br><span>              len = TLVP_LEN(tp, NM_ATT_MANUF_ID);</span><br><span> </span><br><span>             /* log potential BTS feature vector overflow */</span><br><span style="color: hsl(0, 100%, 40%);">-         if (len > sizeof(bts->_features_data))</span><br><span style="color: hsl(120, 100%, 40%);">+          if (len > sizeof(bts->_features_data)) {</span><br><span>                       LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: feature vector is truncated to %u bytes\n",</span><br><span>                              bts->nr, MAX_BTS_FEATURES/8);</span><br><span style="color: hsl(120, 100%, 40%);">+         }</span><br><span> </span><br><span>                /* check that max. expected BTS attribute is above given feature vector length */</span><br><span style="color: hsl(0, 100%, 40%);">-               if (len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT))</span><br><span style="color: hsl(120, 100%, 40%);">+              if (len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT)) {</span><br><span>                   LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) "</span><br><span>                          "feature vector - most likely it was compiled against newer BSC headers. "</span><br><span>                         "Consider upgrading your BSC to later version.\n",</span><br><span>                         bts->nr, len);</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span> </span><br><span>                memcpy(bts->_features_data, TLVP_VAL(tp, NM_ATT_MANUF_ID), sizeof(bts->_features_data));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-              for (i = 0; i < _NUM_BTS_FEAT; i++)</span><br><span style="color: hsl(0, 100%, 40%);">-                  if (osmo_bts_has_feature(&bts->features, i) != osmo_bts_has_feature(&bts->model->features, i))</span><br><span style="color: hsl(120, 100%, 40%);">+               for (i = 0; i < _NUM_BTS_FEAT; i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (osmo_bts_has_feature(&bts->features, i) != osmo_bts_has_feature(&bts->model->features, i)) {</span><br><span>                            LOGP(DNM, LOGL_NOTICE, "BTS%u feature '%s' reported via OML does not match statically "</span><br><span>                                 "set feature: %u != %u. Please fix.\n", bts->nr,</span><br><span>                                get_value_string(osmo_bts_features_descs, i),</span><br><span>                                osmo_bts_has_feature(&bts->features, i), osmo_bts_has_feature(&bts->model->features, i));</span><br><span style="color: hsl(120, 100%, 40%);">+                       }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span>    }</span><br><span> </span><br><span>        /* Parse Attribute Response Info content for 3GPP TS 52.021 ยง9.4.28 Manufacturer Dependent State */</span><br><span>@@ -607,10 +611,11 @@</span><br><span>                 if (rc > 0) {</span><br><span>                     for (i = 0; i < rc; i++) {</span><br><span>                                if (!handle_attr(bts, str2btsattr((const char *)sw_descr[i].file_id),</span><br><span style="color: hsl(0, 100%, 40%);">-                                            sw_descr[i].file_version, sw_descr[i].file_version_len))</span><br><span style="color: hsl(120, 100%, 40%);">+                                              sw_descr[i].file_version, sw_descr[i].file_version_len)) {</span><br><span>                                  LOGPFOH(DNM, LOGL_NOTICE, foh, "BTS%u: ARI reported sw[%d/%d]: %s "</span><br><span>                                                "is %s\n", bts->nr, i, rc, sw_descr[i].file_id,</span><br><span>                                                 sw_descr[i].file_version);</span><br><span style="color: hsl(120, 100%, 40%);">+                            }</span><br><span>                    }</span><br><span>            } else {</span><br><span>                     LOGPFOH(DNM, LOGL_ERROR, foh, "BTS%u: failed to parse SW-Config part of "</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/18595">change 18595</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/+/18595"/><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: I74fbb46920c74a194c296feeeb1bb086fcbd572f </div>
<div style="display:none"> Gerrit-Change-Number: 18595 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>