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

pespin gerrit-no-reply at lists.osmocom.org
Mon Jun 28 14:10:59 UTC 2021


pespin has uploaded this change for review. ( 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(-)



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

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: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210628/eb704d45/attachment.htm>


More information about the gerrit-log mailing list