From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org, donald.hunter@gmail.com,
almasrymina@google.com, sdf@fomichev.me,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 2/5] tools: ynl-gen: move free printing to the print_type_full() helper
Date: Tue, 22 Jul 2025 09:19:24 -0700 [thread overview]
Message-ID: <20250722161927.3489203-3-kuba@kernel.org> (raw)
In-Reply-To: <20250722161927.3489203-1-kuba@kernel.org>
Just to avoid making the main function even more enormous,
before adding more things to print move the free printing
to a helper which already prints the type.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/net/ynl/pyynl/ynl_gen_c.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
index 1bdcc368e776..dc78542e6c88 100755
--- a/tools/net/ynl/pyynl/ynl_gen_c.py
+++ b/tools/net/ynl/pyynl/ynl_gen_c.py
@@ -2546,6 +2546,10 @@ _C_KW = {
def print_type_full(ri, struct):
_print_type(ri, "", struct)
+ if struct.request and struct.in_multi_val:
+ free_rsp_nested_prototype(ri)
+ ri.cw.nl()
+
def print_type_helpers(ri, direction, deref=False):
print_free_prototype(ri, direction)
@@ -3517,9 +3521,6 @@ _C_KW = {
for attr_set, struct in parsed.pure_nested_structs.items():
ri = RenderInfo(cw, parsed, args.mode, "", "", attr_set)
print_type_full(ri, struct)
- if struct.request and struct.in_multi_val:
- free_rsp_nested_prototype(ri)
- cw.nl()
for op_name, op in parsed.ops.items():
cw.p(f"/* ============== {op.enum_name} ============== */")
--
2.50.1
next prev parent reply other threads:[~2025-07-22 16:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 16:19 [PATCH net-next 0/5] tools: ynl-gen: print setters for multi-val attrs Jakub Kicinski
2025-07-22 16:19 ` [PATCH net-next 1/5] tools: ynl-gen: don't add suffix for pure types Jakub Kicinski
2025-07-23 8:52 ` Donald Hunter
2025-07-22 16:19 ` Jakub Kicinski [this message]
2025-07-23 8:58 ` [PATCH net-next 2/5] tools: ynl-gen: move free printing to the print_type_full() helper Donald Hunter
2025-07-22 16:19 ` [PATCH net-next 3/5] tools: ynl-gen: print alloc helper for multi-val attrs Jakub Kicinski
2025-07-23 9:07 ` Donald Hunter
2025-07-22 16:19 ` [PATCH net-next 4/5] tools: ynl-gen: print setters " Jakub Kicinski
2025-07-23 9:15 ` Donald Hunter
2025-07-22 16:19 ` [PATCH net-next 5/5] selftests: drv-net: devmem: use new mattr ynl helpers Jakub Kicinski
2025-07-22 21:05 ` Mina Almasry
2025-07-23 9:15 ` Donald Hunter
2025-07-22 23:37 ` [PATCH net-next 0/5] tools: ynl-gen: print setters for multi-val attrs Stanislav Fomichev
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=20250722161927.3489203-3-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.