From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/2] shared/sec: rename func for getting parse err msg
Date: Fri, 31 May 2019 12:35:38 +0900 [thread overview]
Message-ID: <1559273739-25977-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1559273739-25977-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
The name of function for getting error message from its object is
`make_decode_error_message()`, but it is not describing this feature.
This update is to rename the function to `get_parse_err_msg()` simply.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
.../secondary/spp_worker_th/command_proc.c | 25 +++++++++----------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/shared/secondary/spp_worker_th/command_proc.c b/src/shared/secondary/spp_worker_th/command_proc.c
index 17d0645..fae9aab 100644
--- a/src/shared/secondary/spp_worker_th/command_proc.c
+++ b/src/shared/secondary/spp_worker_th/command_proc.c
@@ -801,34 +801,34 @@ execute_command(const struct spp_command *command)
return ret;
}
-/* Fill err_msg obj with given error message. */
+/* Get error message of parsing from given wk_err_msg object. */
static const char *
-make_decode_error_message(
- const struct sppwk_parse_err_msg *err_msg,
+get_parse_err_msg(
+ const struct sppwk_parse_err_msg *wk_err_msg,
char *message)
{
- switch (err_msg->code) {
+ switch (wk_err_msg->code) {
case SPPWK_PARSE_WRONG_FORMAT:
sprintf(message, "Wrong message format");
break;
case SPPWK_PARSE_UNKNOWN_CMD:
/* TODO(yasufum) Fix compile err if space exists before "(" */
- sprintf(message, "Unknown command(%s)", err_msg->details);
+ sprintf(message, "Unknown command(%s)", wk_err_msg->details);
break;
case SPPWK_PARSE_NO_PARAM:
sprintf(message, "No or insufficient number of params (%s)",
- err_msg->msg);
+ wk_err_msg->msg);
break;
case SPPWK_PARSE_INVALID_TYPE:
sprintf(message, "Invalid value type (%s)",
- err_msg->msg);
+ wk_err_msg->msg);
break;
case SPPWK_PARSE_INVALID_VALUE:
- sprintf(message, "Invalid value (%s)", err_msg->msg);
+ sprintf(message, "Invalid value (%s)", wk_err_msg->msg);
break;
default:
@@ -866,22 +866,21 @@ set_command_results(struct command_result *result,
static void
set_decode_error_to_results(struct command_result *results,
const struct sppwk_cmd_req *request,
- const struct sppwk_parse_err_msg *err_msg)
+ const struct sppwk_parse_err_msg *wk_err_msg)
{
int i;
const char *tmp_buff;
char error_messege[CMD_RES_ERR_MSG_SIZE];
for (i = 0; i < request->num_command; i++) {
- if (err_msg->code == 0)
+ if (wk_err_msg->code == 0)
set_command_results(&results[i], CRES_SUCCESS, "");
else
set_command_results(&results[i], CRES_INVALID, "");
}
- if (err_msg->code != 0) {
- tmp_buff = make_decode_error_message(err_msg,
- error_messege);
+ if (wk_err_msg->code != 0) {
+ tmp_buff = get_parse_err_msg(wk_err_msg, error_messege);
set_command_results(&results[request->num_valid_command],
CRES_FAILURE, tmp_buff);
}
--
2.17.1
next prev parent reply other threads:[~2019-05-31 3:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 3:35 [spp] [PATCH 0/2] Rename functions for parsing error messages ogawa.yasufumi
2019-05-31 3:35 ` ogawa.yasufumi [this message]
2019-05-31 3:35 ` [spp] [PATCH 2/2] shared/sec: rename func for setup err msg ogawa.yasufumi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1559273739-25977-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).