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 C1CA0A05D3 for ; Tue, 21 May 2019 04:34:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B81604F91; Tue, 21 May 2019 04:34:12 +0200 (CEST) Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id 1CB984C80 for ; Tue, 21 May 2019 04:34:09 +0200 (CEST) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4L2Y88H003184; Tue, 21 May 2019 11:34:08 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id A0461638845; Tue, 21 May 2019 11:34:08 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 92726638746; Tue, 21 May 2019 11:34:08 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Tue, 21 May 2019 11:31:40 +0900 Message-Id: <1558405903-8252-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558405903-8252-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1558405903-8252-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 1/4] shared/sec: rename define for empty params 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 define `DECODE_PARAMETER_LIST_EMPTY` is a set of null vars used for command which takes no params. It is redundant and ambiguous for meaning. This update is to rename to `SPPWK_CMD_NO_PARAMS`. Signed-off-by: Yasufumi Ogawa --- .../secondary/spp_worker_th/cmd_parser.c | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c index 84e5b55..6122cee 100644 --- a/src/shared/secondary/spp_worker_th/cmd_parser.c +++ b/src/shared/secondary/spp_worker_th/cmd_parser.c @@ -710,8 +710,6 @@ parse_cls_port(void *cls_cmd_attr, const char *arg_val, return SPP_RET_OK; } -#define DECODE_PARAMETER_LIST_EMPTY { NULL, 0, NULL } - /* parameter list for decoding */ struct decode_parameter_list { const char *name; /* Parameter name */ @@ -720,10 +718,13 @@ struct decode_parameter_list { /* Pointer to parameter handling function */ }; +/* Used for command which takes no params, such as `status`. */ +#define SPPWK_CMD_NO_PARAMS { NULL, 0, NULL } + /* parameter list for each command */ static struct decode_parameter_list parameter_list[][SPPWK_MAX_PARAMS] = { - { /* classifier_table(mac) */ + { /* classifier_table(mac) */ { .name = "action", .offset = offsetof(struct spp_command, @@ -748,9 +749,9 @@ parameter_list[][SPPWK_MAX_PARAMS] = { spec.cls_table), .func = parse_cls_port }, - DECODE_PARAMETER_LIST_EMPTY, + SPPWK_CMD_NO_PARAMS, }, - { /* classifier_table(VLAN) */ + { /* classifier_table(VLAN) */ { .name = "action", .offset = offsetof(struct spp_command, @@ -781,12 +782,12 @@ parameter_list[][SPPWK_MAX_PARAMS] = { spec.cls_table), .func = parse_cls_port }, - DECODE_PARAMETER_LIST_EMPTY, + SPPWK_CMD_NO_PARAMS, }, - { DECODE_PARAMETER_LIST_EMPTY }, /* _get_client_id */ - { DECODE_PARAMETER_LIST_EMPTY }, /* status */ - { DECODE_PARAMETER_LIST_EMPTY }, /* exit */ - { /* component */ + { SPPWK_CMD_NO_PARAMS }, /* _get_client_id */ + { SPPWK_CMD_NO_PARAMS }, /* status */ + { SPPWK_CMD_NO_PARAMS }, /* exit */ + { /* component */ { .name = "action", .offset = offsetof(struct spp_command, @@ -808,9 +809,9 @@ parameter_list[][SPPWK_MAX_PARAMS] = { .offset = offsetof(struct spp_command, spec.comp), .func = decode_component_type_value }, - DECODE_PARAMETER_LIST_EMPTY, + SPPWK_CMD_NO_PARAMS, }, - { /* port */ + { /* port */ { .name = "action", .offset = offsetof(struct spp_command, @@ -847,9 +848,9 @@ parameter_list[][SPPWK_MAX_PARAMS] = { .offset = offsetof(struct spp_command, spec.port), .func = decode_port_pcp }, - DECODE_PARAMETER_LIST_EMPTY, + SPPWK_CMD_NO_PARAMS, }, - { DECODE_PARAMETER_LIST_EMPTY }, /* termination */ + { SPPWK_CMD_NO_PARAMS }, /* termination */ }; /* Validate given command. */ -- 2.17.1