[MERGED] osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Vadim Yanitskiy has submitted this change and it was merged. Change subject: libmsc/gsm_04_80.c: drop unused 'in_msg' argument .. libmsc/gsm_04_80.c: drop unused 'in_msg' argument It isn't used, so no need to pass it. Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b --- M include/osmocom/msc/gsm_04_80.h M src/libmsc/gsm_04_80.c M src/libmsc/ussd.c 3 files changed, 9 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 7da45a0..dedf243 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -7,10 +7,9 @@ struct gsm_subscriber_connection; int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, + const char* response_text, const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, -const struct msgb *msg, const struct ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index 37e058c..12b41a1 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -62,8 +62,7 @@ /* Send response to a mobile-originated ProcessUnstructuredSS-Request */ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char *response_text, - const struct ss_request *req) + const char *response_text, const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD RSP"); struct gsm48_hdr *gh; @@ -110,7 +109,6 @@ } int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, -const struct msgb *in_msg, const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REJ"); diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index eeab52a..748cfbb 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -40,7 +40,8 @@ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; /* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +static int send_own_number(struct gsm_subscriber_connection *conn, + const struct ss_request *req) { char *own_number = conn->vsub->msisdn; char response_string[GSM_EXTENSION_LENGTH + 20]; @@ -50,7 +51,7 @@ /* Need trailing CR as EOT character */ snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, msg, response_string, req); + return gsm0480_send_ussd_response(conn, response_string, req); } /* Entrypoint - handler function common to all mobile-originated USSDs */ @@ -72,7 +73,7 @@ rc = gsm0480_decode_ss_request(gh, msgb_l3len(msg), &req); if (!rc) { DEBUGP(DMM, "Unhandled SS\n"); - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); return rc; } @@ -80,7 +81,7 @@ if (req.ussd_text[0] == '\0' || req.ussd_text[0] == 0xFF) { if (req.ss_code > 0) { /* Assume interrogateSS or modification of it and reject */ - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); return rc; } /* Still assuming a Release-Complete and returning */ @@ -90,10 +91,10 @@ msc_subscr_conn_communicating(conn); if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.ussd_text)) { DEBUGP(DMM, "USSD: Own number requested\n"); - rc = send_own_number(conn, msg, &req); + rc = send_own_number(conn, &req); } else { DEBUGP(DMM, "Unhandled USSD %s\n", req.ussd_text); - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); } return rc; -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerri
osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No
[PATCH] osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/7674 to look at the new patch set (#3). libmsc/gsm_04_80.c: drop unused 'in_msg' argument It isn't used, so no need to pass it. Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b --- M include/osmocom/msc/gsm_04_80.h M src/libmsc/gsm_04_80.c M src/libmsc/ussd.c 3 files changed, 9 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/74/7674/3 diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 7da45a0..dedf243 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -7,10 +7,9 @@ struct gsm_subscriber_connection; int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, + const char* response_text, const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, -const struct msgb *msg, const struct ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index 37e058c..12b41a1 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -62,8 +62,7 @@ /* Send response to a mobile-originated ProcessUnstructuredSS-Request */ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char *response_text, - const struct ss_request *req) + const char *response_text, const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD RSP"); struct gsm48_hdr *gh; @@ -110,7 +109,6 @@ } int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, -const struct msgb *in_msg, const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REJ"); diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index eeab52a..748cfbb 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -40,7 +40,8 @@ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; /* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +static int send_own_number(struct gsm_subscriber_connection *conn, + const struct ss_request *req) { char *own_number = conn->vsub->msisdn; char response_string[GSM_EXTENSION_LENGTH + 20]; @@ -50,7 +51,7 @@ /* Need trailing CR as EOT character */ snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, msg, response_string, req); + return gsm0480_send_ussd_response(conn, response_string, req); } /* Entrypoint - handler function common to all mobile-originated USSDs */ @@ -72,7 +73,7 @@ rc = gsm0480_decode_ss_request(gh, msgb_l3len(msg), &req); if (!rc) { DEBUGP(DMM, "Unhandled SS\n"); - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); return rc; } @@ -80,7 +81,7 @@ if (req.ussd_text[0] == '\0' || req.ussd_text[0] == 0xFF) { if (req.ss_code > 0) { /* Assume interrogateSS or modification of it and reject */ - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); return rc; } /* Still assuming a Release-Complete and returning */ @@ -90,10 +91,10 @@ msc_subscr_conn_communicating(conn); if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.ussd_text)) { DEBUGP(DMM, "USSD: Own number requested\n"); - rc = send_own_number(conn, msg, &req); + rc = send_own_number(conn, &req); } else { DEBUGP(DMM, "Unhandled USSD %s\n", req.ussd_text); - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); } return rc; -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy
osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No
osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Patch Set 1: > About indenting style, personally I don't like this style. [..] Everyone of course has their own preference, and everyone is entitled to have that. However, in any software project it is generally good if there is a common style to be followed by all the code, as it enhances readability across the project. It doesn't really matter which style it is, just as long as everyone is following it. In Osmocom, we indent additional argument to the point behind the opening parenthesis. So I would like to ask you to follow that, thanks! -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No
osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Patch Set 2: About indenting style, personally I don't like this style. This occupies the potential space, that could be used for listing arguments, by useless spaces and tabs just in order to make the code look aligned... Also, some parts of this code are to be modified in the near future, so I would not care too much about it. -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No
osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/7674/1/include/osmocom/msc/gsm_04_80.h File include/osmocom/msc/gsm_04_80.h: Line 10:const char* response_text, const struct ss_request *req); (I would rather keep the same indenting style as below, and for added bonus just modify the single line so the patch touches as few lines as possible) https://gerrit.osmocom.org/#/c/7674/1/src/libmsc/ussd.c File src/libmsc/ussd.c: Line 44:const struct ss_request *req) (again, indent: rather stay with the style of surrounding code. Most editors do that indenting automatically) -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes
osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No
[PATCH] osmo-msc[master]: libmsc/gsm_04_80.c: drop unused 'in_msg' argument
Review at https://gerrit.osmocom.org/7674 libmsc/gsm_04_80.c: drop unused 'in_msg' argument Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b --- M include/osmocom/msc/gsm_04_80.h M src/libmsc/gsm_04_80.c M src/libmsc/ussd.c 3 files changed, 10 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/74/7674/1 diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 7da45a0..4b4ba10 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -7,11 +7,9 @@ struct gsm_subscriber_connection; int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, - const struct ss_request *req); + const char* response_text, const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, -const struct msgb *msg, -const struct ss_request *request); + const struct ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index 37e058c..12b41a1 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -62,8 +62,7 @@ /* Send response to a mobile-originated ProcessUnstructuredSS-Request */ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char *response_text, - const struct ss_request *req) + const char *response_text, const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD RSP"); struct gsm48_hdr *gh; @@ -110,7 +109,6 @@ } int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, -const struct msgb *in_msg, const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REJ"); diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index eeab52a..ce8939a 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -40,7 +40,8 @@ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; /* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +static int send_own_number(struct gsm_subscriber_connection *conn, + const struct ss_request *req) { char *own_number = conn->vsub->msisdn; char response_string[GSM_EXTENSION_LENGTH + 20]; @@ -50,7 +51,7 @@ /* Need trailing CR as EOT character */ snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, msg, response_string, req); + return gsm0480_send_ussd_response(conn, response_string, req); } /* Entrypoint - handler function common to all mobile-originated USSDs */ @@ -72,7 +73,7 @@ rc = gsm0480_decode_ss_request(gh, msgb_l3len(msg), &req); if (!rc) { DEBUGP(DMM, "Unhandled SS\n"); - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); return rc; } @@ -80,7 +81,7 @@ if (req.ussd_text[0] == '\0' || req.ussd_text[0] == 0xFF) { if (req.ss_code > 0) { /* Assume interrogateSS or modification of it and reject */ - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); return rc; } /* Still assuming a Release-Complete and returning */ @@ -90,10 +91,10 @@ msc_subscr_conn_communicating(conn); if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.ussd_text)) { DEBUGP(DMM, "USSD: Own number requested\n"); - rc = send_own_number(conn, msg, &req); + rc = send_own_number(conn, &req); } else { DEBUGP(DMM, "Unhandled USSD %s\n", req.ussd_text); - rc = gsm0480_send_ussd_reject(conn, msg, &req); + rc = gsm0480_send_ussd_reject(conn, &req); } return rc; -- To view, visit https://gerrit.osmocom.org/7674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy