From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id F4124A045E for ; Fri, 31 May 2019 05:38:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 468824F91; Fri, 31 May 2019 05:38:15 +0200 (CEST) Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 09A1F2C55 for ; Fri, 31 May 2019 05:38:12 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4V3cB6u029251; Fri, 31 May 2019 12:38:11 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 16D74EA85CB; Fri, 31 May 2019 12:38:11 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 09C16EA85C5; Fri, 31 May 2019 12:38:11 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Fri, 31 May 2019 12:35:38 +0900 Message-Id: <1559273739-25977-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559273739-25977-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1559273739-25977-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 1/2] shared/sec: rename func for getting parse err msg X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa 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 --- .../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