aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/osmo_bsc_bssap.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-23 01:04:59 +0100
committerHarald Welte <laforge@gnumonks.org>2018-01-28 03:07:16 +0100
commitc751513c04b8422caf8ac33f4500c62381da231a (patch)
tree6cfa35623e4676cf94a8a461f5fd77bb76877131 /src/osmo-bsc/osmo_bsc_bssap.c
parent56dd9815eb4413c6100d367df2db77dde2fa6bde (diff)
cosmetic: Remove data/len variables in bssmap_handle_assignm_req()
There's nothing wrong with passing the TLVP_VAL/TLVP_LEN directly into the gsm0808 decoder functions, let's avoid variables that get assigned and used only once - particularly with such generic names. Change-Id: I8557b4a9ff4de28b76c7d618631a4700176a8669
Diffstat (limited to 'src/osmo-bsc/osmo_bsc_bssap.c')
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 67ff23037..586657f41 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -744,8 +744,6 @@ static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
struct gsm0808_speech_codec_list scl;
struct gsm0808_speech_codec_list *scl_ptr = NULL;
int rc;
- const uint8_t *data;
- char len;
if (!conn->conn) {
LOGP(DMSC, LOGL_ERROR,
@@ -771,9 +769,8 @@ static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
multiplex = (conn->user_plane.cic & ~0x1f) >> 5;
} else if (TLVP_PRESENT(&tp, GSM0808_IE_AOIP_TRASP_ADDR)) {
/* Decode AoIP transport address element */
- data = TLVP_VAL(&tp, GSM0808_IE_AOIP_TRASP_ADDR);
- len = TLVP_LEN(&tp, GSM0808_IE_AOIP_TRASP_ADDR);
- rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, data, len);
+ rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, TLVP_VAL(&tp, GSM0808_IE_AOIP_TRASP_ADDR),
+ TLVP_LEN(&tp, GSM0808_IE_AOIP_TRASP_ADDR));
if (rc < 0) {
LOGP(DMSC, LOGL_ERROR,
"Unable to decode aoip transport address.\n");
@@ -796,9 +793,8 @@ static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
}
/* Decode Speech Codec list */
- data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST);
- len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST);
- rc = gsm0808_dec_speech_codec_list(&scl, data, len);
+ rc = gsm0808_dec_speech_codec_list(&scl, TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST),
+ TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST));
if (rc < 0) {
LOGP(DMSC, LOGL_ERROR,
"Unable to decode speech codec list\n");
@@ -808,9 +804,8 @@ static int bssmap_handle_assignm_req(struct osmo_bsc_sccp_con *conn,
}
/* Decode Channel Type element */
- data = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE);
- len = TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE);
- rc = gsm0808_dec_channel_type(&ct, data, len);
+ rc = gsm0808_dec_channel_type(&ct, TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE),
+ TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE));
if (rc < 0) {
LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n");
goto reject;