Commit 168dea20 authored by Jakub Kicinski's avatar Jakub Kicinski

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: default avatarJakub Kicinski <kuba@kernel.org>
parent eae7af21
...@@ -1235,10 +1235,6 @@ def print_dump_prototype(ri): ...@@ -1235,10 +1235,6 @@ def print_dump_prototype(ri):
print_prototype(ri, "request") 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): def put_typol(cw, struct):
type_max = struct.attr_set.max_name type_max = struct.attr_set.max_name
cw.block_start(line=f'struct ynl_policy_attr {struct.render_name}_policy[{type_max} + 1] =') cw.block_start(line=f'struct ynl_policy_attr {struct.render_name}_policy[{type_max} + 1] =')
...@@ -2485,12 +2481,10 @@ def main(): ...@@ -2485,12 +2481,10 @@ def main():
cw.nl() cw.nl()
cw.p('/* Policies */') cw.p('/* Policies */')
for name, _ in parsed.attr_sets.items(): for name in parsed.pure_nested_structs:
struct = Struct(parsed, name) struct = Struct(parsed, name)
put_typol_fwd(cw, struct) put_typol(cw, struct)
cw.nl() for name in parsed.root_sets:
for name, _ in parsed.attr_sets.items():
struct = Struct(parsed, name) struct = Struct(parsed, name)
put_typol(cw, struct) put_typol(cw, struct)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment