Change in osmo-bsc[master]: abis_nm: cosmetic: add curly braces to complex 'if' statements

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Fri May 29 19:48:44 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18595 )


Change subject: abis_nm: cosmetic: add curly braces to complex 'if' statements
......................................................................

abis_nm: cosmetic: add curly braces to complex 'if' statements

Change-Id: I74fbb46920c74a194c296feeeb1bb086fcbd572f
---
M src/osmo-bsc/abis_nm.c
1 file changed, 10 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/18595/1

diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index 4ed0602..a0aead8 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -570,25 +570,29 @@
 		len = TLVP_LEN(tp, NM_ATT_MANUF_ID);
 
 		/* log potential BTS feature vector overflow */
-		if (len > sizeof(bts->_features_data))
+		if (len > sizeof(bts->_features_data)) {
 			LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: feature vector is truncated to %u bytes\n",
 			     bts->nr, MAX_BTS_FEATURES/8);
+		}
 
 		/* check that max. expected BTS attribute is above given feature vector length */
-		if (len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT))
+		if (len > OSMO_BYTES_FOR_BITS(_NUM_BTS_FEAT)) {
 			LOGP(DNM, LOGL_NOTICE, "BTS%u Get Attributes Response: reported unexpectedly long (%u bytes) "
 			     "feature vector - most likely it was compiled against newer BSC headers. "
 			     "Consider upgrading your BSC to later version.\n",
 			     bts->nr, len);
+		}
 
 		memcpy(bts->_features_data, TLVP_VAL(tp, NM_ATT_MANUF_ID), sizeof(bts->_features_data));
 
-		for (i = 0; i < _NUM_BTS_FEAT; i++)
-			if (osmo_bts_has_feature(&bts->features, i) != osmo_bts_has_feature(&bts->model->features, i))
+		for (i = 0; i < _NUM_BTS_FEAT; i++) {
+			if (osmo_bts_has_feature(&bts->features, i) != osmo_bts_has_feature(&bts->model->features, i)) {
 				LOGP(DNM, LOGL_NOTICE, "BTS%u feature '%s' reported via OML does not match statically "
 				     "set feature: %u != %u. Please fix.\n", bts->nr,
 				     get_value_string(osmo_bts_features_descs, i),
 				     osmo_bts_has_feature(&bts->features, i), osmo_bts_has_feature(&bts->model->features, i));
+			}
+		}
 	}
 
 	/* Parse Attribute Response Info content for 3GPP TS 52.021 §9.4.28 Manufacturer Dependent State */
@@ -607,10 +611,11 @@
 		if (rc > 0) {
 			for (i = 0; i < rc; i++) {
 				if (!handle_attr(bts, str2btsattr((const char *)sw_descr[i].file_id),
-						 sw_descr[i].file_version, sw_descr[i].file_version_len))
+						 sw_descr[i].file_version, sw_descr[i].file_version_len)) {
 					LOGPFOH(DNM, LOGL_NOTICE, foh, "BTS%u: ARI reported sw[%d/%d]: %s "
 						"is %s\n", bts->nr, i, rc, sw_descr[i].file_id,
 						sw_descr[i].file_version);
+				}
 			}
 		} else {
 			LOGPFOH(DNM, LOGL_ERROR, foh, "BTS%u: failed to parse SW-Config part of "

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I74fbb46920c74a194c296feeeb1bb086fcbd572f
Gerrit-Change-Number: 18595
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200529/dd3e97c4/attachment.htm>


More information about the gerrit-log mailing list