aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-07-23 17:10:43 +0000
committerJakub Kicinski <[email protected]>2025-07-25 00:28:49 +0000
commitcf5869977702b1d51e3b4d58b6c559a98a366114 (patch)
treeb749d820326adcd16211d90065a7f9b7b0ef1e7e
parenttools: ynl-gen: don't add suffix for pure types (diff)
downloadkernel-cf5869977702b1d51e3b4d58b6c559a98a366114.tar.gz
kernel-cf5869977702b1d51e3b4d58b6c559a98a366114.zip
tools: ynl-gen: move free printing to the print_type_full() helper
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. Reviewed-by: Donald Hunter <[email protected]> Acked-by: Stanislav Fomichev <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rwxr-xr-xtools/net/ynl/pyynl/ynl_gen_c.py7
1 files 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 @@ def print_type(ri, direction):
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 @@ def main():
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} ============== */")