Soft Patch Panel
 help / color / mirror / Atom feed
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/4] shared/sec: rename define for empty params
Date: Tue, 21 May 2019 11:31:40 +0900	[thread overview]
Message-ID: <1558405903-8252-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1558405903-8252-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

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 <ogawa.yasufumi@lab.ntt.co.jp>
---
 .../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


  reply	other threads:[~2019-05-21  2:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21  2:31 [spp] [PATCH 0/4] Revise name of funcs and data for parsing ogawa.yasufumi
2019-05-21  2:31 ` ogawa.yasufumi [this message]
2019-05-21  2:31 ` [spp] [PATCH 2/4] shared/sec: rename struct of cmd operators ogawa.yasufumi
2019-05-21  2:31 ` [spp] [PATCH 3/4] shared/sec: rename func for parsing given command ogawa.yasufumi
2019-05-21  2:31 ` [spp] [PATCH 4/4] shared/sec: rename operator func for parsing cmds 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=1558405903-8252-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).