Change in osmocom-bb[master]: layer23: fix tons of compiler warnings, mostly OSMO_DEPRECATED related

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue May 28 06:32:34 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14136 )

Change subject: layer23: fix tons of compiler warnings, mostly OSMO_DEPRECATED related
......................................................................

layer23: fix tons of compiler warnings, mostly OSMO_DEPRECATED related

Change-Id: I03918bd864c711b377a795186123c85bb6f4dc4a
---
M src/host/layer23/src/common/networks.c
M src/host/layer23/src/misc/bcch_scan.c
M src/host/layer23/src/mobile/gsm322.c
M src/host/layer23/src/mobile/gsm411_sms.c
M src/host/layer23/src/mobile/gsm480_ss.c
M src/host/layer23/src/mobile/gsm48_rr.c
M src/host/layer23/src/mobile/subscriber.c
7 files changed, 36 insertions(+), 26 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/layer23/src/common/networks.c b/src/host/layer23/src/common/networks.c
index 40b70a1..b4757e9 100644
--- a/src/host/layer23/src/common/networks.c
+++ b/src/host/layer23/src/common/networks.c
@@ -1822,33 +1822,33 @@
 
 const char *gsm_print_mcc(uint16_t mcc)
 {
-	static char string[5] = "000";
+	static char string[6] = "000";
 
-	snprintf(string, 4, "%03x", mcc);
+	snprintf(string, 5, "%03x", mcc);
 	return string;
 }
 
 const char *gsm_print_mnc(uint16_t mnc)
 {
-	static char string[7];
+	static char string[8];
 
 	/* invalid format: return hex value */
 	if ((mnc & 0xf000)
 	 || (mnc & 0x0f00) > 0x0900
 	 || (mnc & 0x00f0) > 0x0090
 	 || ((mnc & 0x000f) > 0x0009 && (mnc & 0x000f) < 0x000f)) {
-		snprintf(string, 6, "0x%03x", mnc);
+		snprintf(string, 7, "0x%03x", mnc);
 		return string;
 	}
 
 	/* two digits */
 	if ((mnc & 0x000f) == 0x000f) {
-		snprintf(string, 6, "%02x", mnc >> 4);
+		snprintf(string, 7, "%02x", mnc >> 4);
 		return string;
 	}
 
 	/* three digits */
-	snprintf(string, 6, "%03x", mnc);
+	snprintf(string, 7, "%03x", mnc);
 	return string;
 }
 
diff --git a/src/host/layer23/src/misc/bcch_scan.c b/src/host/layer23/src/misc/bcch_scan.c
index 3ba3a1c..5dc0bc3 100644
--- a/src/host/layer23/src/misc/bcch_scan.c
+++ b/src/host/layer23/src/misc/bcch_scan.c
@@ -199,9 +199,13 @@
 	case BSCAN_S_WAIT_DATA:
 		cinfo_next_cell(data);
 		break;
+	case BSCAN_S_NONE:
+	case BSCAN_S_DONE:
+		break;
 	}
 }
 
+#if 0
 /* Update cell_info for current cell with received BCCH info */
 static int rx_bcch_info(const uint8_t *data)
 {
@@ -233,12 +237,13 @@
 static int rx_sch_info()
 {
 	/* FIXME */
+	return 0;
 }
+#endif
 
 static int bscan_sig_cb(unsigned int subsys, unsigned int signal,
 		     void *handler_data, void *signal_data)
 {
-	struct cell_info *ci = fps.cur_cell;
 	struct osmocom_ms *ms;
 	struct osmobb_meas_res *mr;
 	uint16_t arfcn;
@@ -279,6 +284,9 @@
 			}
 			_cinfo_start_arfcn(rc);
 			break;
+		case FPS_S_NONE:
+		case FPS_S_BINFO:
+			break;
 		}
 		break;
 	case S_L1CTL_FBSB_RESP:
diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c
index bfe6329..cfd70d8 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -1867,7 +1867,7 @@
 
 		/* check C1 criteria not fullfilled */
 		// TODO: class 3 DCS mobile
-		band = gsm_arfcn2band(index2arfcn(i));
+		gsm_arfcn2band_rc(index2arfcn(i), &band);
 		class = class_of_band(ms, band);
 		c1 = calculate_c1(DCS, rxlev2dbm(cs->list[i].rxlev),
 			s->rxlev_acc_min_db,
@@ -4129,7 +4129,8 @@
 	struct gsm48_sysinfo *s;
 	int i = 0, reselect = 0;
 	uint16_t acc_class;
-	int band, class;
+	int class;
+	enum gsm_band band;
 	struct gsm322_neighbour *nb;
 	time_t now;
 	char arfcn_text[10];
@@ -4200,7 +4201,7 @@
 			nb->prio_low = 1;
 
 		/* get C1 & C2 */
-		band = gsm_arfcn2band(nb->arfcn);
+		gsm_arfcn2band_rc(nb->arfcn, &band);
 		class = class_of_band(ms, band);
 		nb->c1 = calculate_c1(DNB, nb->rla_c_dbm, s->rxlev_acc_min_db,
 			ms_pwr_dbm(band, s->ms_txpwr_max_cch),
@@ -4697,9 +4698,11 @@
 	struct llist_head sorted;
 	struct llist_head *lh, *lh2;
 	struct gsm48_sysinfo *s = &cs->sel_si;
-	int band = gsm_arfcn2band(cs->arfcn);
-	int class = class_of_band(cs->ms, band);
+	enum gsm_band band;
+	int class;
 
+	gsm_arfcn2band_rc(cs->arfcn, &band);
+	class = class_of_band(cs->ms, band);
 
 	/* calculate the RAL_C of serving cell */
 	if (cs->rxlev_count) {
diff --git a/src/host/layer23/src/mobile/gsm411_sms.c b/src/host/layer23/src/mobile/gsm411_sms.c
index c476ff4..08df0f2 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -271,8 +271,8 @@
 		strcpy(gsms->address, "0");
 	else
 		gsms->address[0] = '\0';
-	gsm48_decode_bcd_number(gsms->address + strlen(gsms->address),
-		sizeof(gsms->address) - strlen(gsms->address), address_lv, 1);
+	gsm48_decode_bcd_number2(gsms->address + strlen(gsms->address),
+		sizeof(gsms->address) - strlen(gsms->address), address_lv, sizeof(address_lv), 1);
 	smsp += oa_len_bytes;
 
 	gsms->protocol_id = *smsp++;
diff --git a/src/host/layer23/src/mobile/gsm480_ss.c b/src/host/layer23/src/mobile/gsm480_ss.c
index 5ff3ce6..edc9c97 100644
--- a/src/host/layer23/src/mobile/gsm480_ss.c
+++ b/src/host/layer23/src/mobile/gsm480_ss.c
@@ -884,9 +884,9 @@
 					strcpy(number, "0");
 				else
 					number[0] = '\0';
-				gsm48_decode_bcd_number(number + strlen(number),
+				gsm48_decode_bcd_number2(number + strlen(number),
 					sizeof(number) - strlen(number),
-					tag_data - 1, 1);
+					tag_data - 1, tag_len + 1, 1);
 				vty_notify(ms, "Destination: %s\n", number);
 				break;
 			}
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index c074323..a94fc99 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -1516,6 +1516,9 @@
 	int slots;
 	uint8_t chan_req;
 	uint8_t tx_power;
+	enum gsm_band band;
+
+	gsm_arfcn2band_rc(cs->arfcn, &band);
 
 	/* already assigned */
 	if (rr->wait_assign == 2)
@@ -1657,8 +1660,7 @@
 	if (set->alter_tx_power) {
 		tx_power = set->alter_tx_power_value;
 		LOGP(DRR, LOGL_INFO, "Use alternative tx-power %d (%d dBm)\n",
-			tx_power,
-			ms_pwr_dbm(gsm_arfcn2band(cs->arfcn), tx_power));
+			tx_power, ms_pwr_dbm(band, tx_power));
 	} else {
 		tx_power = s->ms_txpwr_max_cch;
 		/* power offset in case of DCS1800 */
@@ -1666,15 +1668,12 @@
 		 && (cs->arfcn & 1023) <= 885) {
 			LOGP(DRR, LOGL_INFO, "Use MS-TXPWR-MAX-CCH power value "
 				"%d (%d dBm) with offset %d dBm\n", tx_power,
-				ms_pwr_dbm(gsm_arfcn2band(cs->arfcn), tx_power),
-				s->po_value * 2);
+				ms_pwr_dbm(band, tx_power), s->po_value * 2);
 			/* use reserved bits 7,8 for offset (+ X * 2dB) */
 			tx_power |= s->po_value << 6;
 		} else
 			LOGP(DRR, LOGL_INFO, "Use MS-TXPWR-MAX-CCH power value "
-				"%d (%d dBm)\n", tx_power,
-				ms_pwr_dbm(gsm_arfcn2band(cs->arfcn),
-							tx_power));
+				"%d (%d dBm)\n", tx_power, ms_pwr_dbm(band, tx_power));
 	}
 	ncch->data[7] = tx_power;
 
diff --git a/src/host/layer23/src/mobile/subscriber.c b/src/host/layer23/src/mobile/subscriber.c
index e1e6331..b2eacc5 100644
--- a/src/host/layer23/src/mobile/subscriber.c
+++ b/src/host/layer23/src/mobile/subscriber.c
@@ -348,9 +348,9 @@
 			strcpy(subscr->sms_sca, "+");
 		if (((smsp->ts_sca[1] & 0x70) >> 4) == 2)
 			strcpy(subscr->sms_sca, "0");
-		gsm48_decode_bcd_number(subscr->sms_sca +
-			strlen(subscr->sms_sca), sizeof(subscr->sms_sca)
-			- strlen(subscr->sms_sca), smsp->ts_sca, 1);
+		gsm48_decode_bcd_number2(subscr->sms_sca + strlen(subscr->sms_sca),
+					 sizeof(subscr->sms_sca) - strlen(subscr->sms_sca),
+					 smsp->ts_sca, sizeof(smsp->ts_sca), 1);
 	}
 
 	LOGP(DMM, LOGL_INFO, "received SMSP from SIM (sca=%s)\n",

-- 
To view, visit https://gerrit.osmocom.org/14136
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I03918bd864c711b377a795186123c85bb6f4dc4a
Gerrit-Change-Number: 14136
Gerrit-PatchSet: 7
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190528/2950e62c/attachment.html>


More information about the gerrit-log mailing list