summaryrefslogtreecommitdiffstats
path: root/tools/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-06-07 22:24:00 +0200
committerJakub Kicinski <kuba@kernel.org>2023-06-08 23:01:10 +0200
commit168dea20ecef59f9e513a8b869da4841775cc49d (patch)
treeb1eb7bb7216d0bddfb15cec95f11c9e9fbacd080 /tools/net
parenttools: ynl-gen: walk nested types in depth (diff)
downloadlinux-168dea20ecef59f9e513a8b869da4841775cc49d.tar.xz
linux-168dea20ecef59f9e513a8b869da4841775cc49d.zip
tools: ynl-gen: don't generate forward declarations for policies
Now that all nested types have structs and are sorted topologically there should be no need to generate forward declarations for policies. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net')
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 0cb0f74e714b..251c5bfffd8d 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -1235,10 +1235,6 @@ def print_dump_prototype(ri):
print_prototype(ri, "request")
-def put_typol_fwd(cw, struct):
- cw.p(f'extern struct ynl_policy_nest {struct.render_name}_nest;')
-
-
def put_typol(cw, struct):
type_max = struct.attr_set.max_name
cw.block_start(line=f'struct ynl_policy_attr {struct.render_name}_policy[{type_max} + 1] =')
@@ -2485,12 +2481,10 @@ def main():
cw.nl()
cw.p('/* Policies */')
- for name, _ in parsed.attr_sets.items():
+ for name in parsed.pure_nested_structs:
struct = Struct(parsed, name)
- put_typol_fwd(cw, struct)
- cw.nl()
-
- for name, _ in parsed.attr_sets.items():
+ put_typol(cw, struct)
+ for name in parsed.root_sets:
struct = Struct(parsed, name)
put_typol(cw, struct)