Message ID | 20230607202403.1089925-9-kuba@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 168dea20ecef59f9e513a8b869da4841775cc49d |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | tools: ynl: generate code for the devlink family | expand |
Context | Check | Description |
---|---|---|
netdev/series_format | success | Posting correctly formatted |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 8 this patch: 8 |
netdev/cc_maintainers | success | CCed 5 of 5 maintainers |
netdev/build_clang | success | Errors and warnings before: 8 this patch: 8 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/deprecated_api | success | None detected |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 8 this patch: 8 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 25 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
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 @@ _C_KW = { 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 @@ _C_KW = { 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)
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> --- tools/net/ynl/ynl-gen-c.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)