Change in osmo-bsc[master]: lchan-select: Avoid setting variable for no reason

laforge gerrit-no-reply at lists.osmocom.org
Wed Jun 30 08:13:52 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24780 )

Change subject: lchan-select: Avoid setting variable for no reason
......................................................................

lchan-select: Avoid setting variable for no reason

That variable is never used after being set. Furthermore, it is being
set to the same value already stored, so there's no use in setting it
and it creates confusion.

Change-Id: Ib6ee28aa9a449992f5d3dea6df7dd2b7e30e73c9
---
M src/osmo-bsc/lchan_select.c
1 file changed, 3 insertions(+), 14 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index 53c4358..a1f6c82 100644
--- a/src/osmo-bsc/lchan_select.c
+++ b/src/osmo-bsc/lchan_select.c
@@ -220,35 +220,24 @@
 	case GSM_LCHAN_TCH_F:
 		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F, log);
 		/* If we don't have TCH/F available, try dynamic TCH/F_PDCH */
-		if (!lchan) {
+		if (!lchan)
 			lchan = _lc_dyn_find_bts(bts, GSM_PCHAN_TCH_F_PDCH,
 						 GSM_PCHAN_TCH_F, log);
-			/* TCH/F_PDCH used as TCH/F -- here, type is already
-			 * set to GSM_LCHAN_TCH_F, but for clarity's sake... */
-			if (lchan)
-				type = GSM_LCHAN_TCH_F;
-		}
 
 		/* Try fully dynamic TCH/F_TCH/H_PDCH as TCH/F... */
-		if (!lchan && bts->network->dyn_ts_allow_tch_f) {
+		if (!lchan && bts->network->dyn_ts_allow_tch_f)
 			lchan = _lc_dyn_find_bts(bts,
 						 GSM_PCHAN_TCH_F_TCH_H_PDCH,
 						 GSM_PCHAN_TCH_F, log);
-			if (lchan)
-				type = GSM_LCHAN_TCH_F;
-		}
 		break;
 	case GSM_LCHAN_TCH_H:
 		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H, log);
 		/* No dedicated TCH/x available -- try fully dynamic
 		 * TCH/F_TCH/H_PDCH */
-		if (!lchan) {
+		if (!lchan)
 			lchan = _lc_dyn_find_bts(bts,
 						 GSM_PCHAN_TCH_F_TCH_H_PDCH,
 						 GSM_PCHAN_TCH_H, log);
-			if (lchan)
-				type = GSM_LCHAN_TCH_H;
-		}
 		break;
 	default:
 		LOG_BTS(bts, DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type);

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib6ee28aa9a449992f5d3dea6df7dd2b7e30e73c9
Gerrit-Change-Number: 24780
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210630/c961c9a5/attachment.htm>


More information about the gerrit-log mailing list