Skip to contentSkip to conversation

buildtools/dpdk-cmdline-gen: fix code gen for IP addresses

PATCH Applied Bruce Richardson 3 participants 3 messages Dec 5, 2023 – Dec 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildtools/dpdk-cmdline-gen: fix code gen for IP addresses

The C code generated for the tokens for matching IP addresses in commandlines was missing the "static" prefix present in the output for the other data-types.

Fixes 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")
---
 buildtools/dpdk-cmdline-gen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
buildtools/dpdk-cmdline-gen.py +1 -1
index 49b03bee4a..bf1253d949 100755
@@ -71,7 +71,7 @@ def process_command(lineno, tokens, comment):
         elif t_type in ["IP", "IP_ADDR", "IPADDR"]:
             result_struct.append(f"\tcmdline_ipaddr_t {t_name};")
             initializers.append(
-                f"cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
+                f"static cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
                 f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result, {t_name});"
             )
         elif t_type.startswith("(") and t_type.endswith(")"):
Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw
Quoted 39 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, December 5, 2023 5:01 PM
To: [email protected]
Cc: Bruce Richardson <[email protected]>; [email protected]; Sunil Kumar Kori <[email protected]>
Subject: [EXT] [PATCH] buildtools/dpdk-cmdline-gen: fix code gen for IP addresses

External Email

----------------------------------------------------------------------
The C code generated for the tokens for matching IP addresses in commandlines was missing the "static" prefix present in the output for the other data-types.

Fixes 37666691e9ed ("buildtools: add a tool to generate cmdline

boilerplate")
Cc: [email protected]

---
 buildtools/dpdk-cmdline-gen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
buildtools/dpdk-cmdline- renamed from buildtools/dpdk-cmdline-gen.py +0 -0

gen.py index 49b03bee4a..bf1253d949 100755

buildtools/dpdk-cmdline-gen.py +1 -1
@@ -71,7 +71,7 @@ def process_command(lineno, tokens, comment):
         elif t_type in ["IP", "IP_ADDR", "IPADDR"]:
             result_struct.append(f"\tcmdline_ipaddr_t {t_name};")
             initializers.append(
-                f"cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
+                f"static cmdline_parse_token_ipaddr_t

cmd_{name}_{t_name}_tok =\n"
f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result,
{t_name});"

Quoted 3 lines
             )
         elif t_type.startswith("(") and t_type.endswith(")"):

--

Quoted 1 line

2.40.1

#2 lore raw
In reply to Bruce Richardson
Quoted 10 lines · Bruce Richardson

The C code generated for the tokens for matching IP addresses in commandlines was missing the "static" prefix present in the output for the other data-types.

Fixes 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")

Applied, thanks Bruce and Sunil.

Signature · 1 line
David Marchand