[MERGED] openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms()
Pablo Neira Ayuso has submitted this change and it was merged. Change subject: gsm_04_11: get rid of unused parameter in sms_route_mt_sms() .. gsm_04_11: get rid of unused parameter in sms_route_mt_sms() This parameter is unused, remove it. Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index acf425a..da4460c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -187,7 +187,7 @@ return gsm411_smc_send(>sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); @@ -277,8 +277,9 @@ return msg->len - old_msg_len; } -int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, -struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred) +static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, + struct gsm_sms *gsms, uint8_t sms_mti, + bool *deferred) { int rc; @@ -342,7 +343,7 @@ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(msg, gsms); + rc = gsm340_rx_sms_submit(gsms); break; case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC: @@ -487,7 +488,7 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, msg, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); out: if (!deferred) sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira AyusoGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso
openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms()
Patch Set 1: Code-Review+2 > I need to call gsm340_rx_sms_submit() in the last patch of this > series, to add support for status-report in nitb mode. Ok, then please state this briefly in the commit log, i.e. tha the code will be called in a context without msgb. This gives important context. -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira AyusoGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No
openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms()
Patch Set 1: I need to call gsm340_rx_sms_submit() in the last patch of this series, to add support for status-report in nitb mode. In such scenario, I have no real msgb object, since the struct gsm_sms object is allocated from the SMPP SUBMIT_SM esm_class = Delivery Acknoledgement. If this patch is kept back, I will have to pass a NULL pointer as parameter here when calling gsm340_rx_sms_submit() from the new sms_status_report() path. -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira AyusoGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No
openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms()
Patch Set 1: I think particularly if all functions are 'static' and within one file, any reasonably optimizing compiler should remove unused function arguments, so this is a bit of a pseudo-discussion here. We do have several places in the code where we pass along some objects either to make function signatures similar with other functions, or if we're not sure if we will need it at a not-too-distant point (if we take a short-cut by not checking some things we should check, e.g.). Summary: I would simply mark the function as static (as in this patch) but not remove unused arguments. But then, honestly, I don't care. We can also simply leave it like it is. -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira AyusoGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No
openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms()
Patch Set 1: This is DEAD code, just consuming more CPU cycles on something we don't need. We can restore this once you need it ;-) Thanks! -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira AyusoGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pablo Neira Ayuso Gerrit-HasComments: No
openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms()
Patch Set 1: Code-Review+1 seems like our habit of passing the rx'd msgb around if anyone would like to query its context, but fair enough -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira AyusoGerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No
[PATCH] openbsc[master]: gsm_04_11: get rid of unused parameter in sms_route_mt_sms()
Review at https://gerrit.osmocom.org/3422 gsm_04_11: get rid of unused parameter in sms_route_mt_sms() This parameter is unused, remove it. Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e --- M openbsc/src/libmsc/gsm_04_11.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/3422/1 diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index acf425a..da4460c 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -187,7 +187,7 @@ return gsm411_smc_send(>sms.smc_inst, msg_type, msg); } -static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) +static int gsm340_rx_sms_submit(struct gsm_sms *gsms) { if (db_sms_store(gsms) != 0) { LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); @@ -277,8 +277,9 @@ return msg->len - old_msg_len; } -int sms_route_mt_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, -struct gsm_sms *gsms, uint8_t sms_mti, bool *deferred) +static int sms_route_mt_sms(struct gsm_subscriber_connection *conn, + struct gsm_sms *gsms, uint8_t sms_mti, + bool *deferred) { int rc; @@ -342,7 +343,7 @@ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: /* MS is submitting a SMS */ - rc = gsm340_rx_sms_submit(msg, gsms); + rc = gsm340_rx_sms_submit(gsms); break; case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC: @@ -487,7 +488,7 @@ /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); - rc = sms_route_mt_sms(conn, msg, gsms, sms_mti, deferred); + rc = sms_route_mt_sms(conn, gsms, sms_mti, deferred); out: if (!deferred) sms_free(gsms); -- To view, visit https://gerrit.osmocom.org/3422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Pablo Neira Ayuso