diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-03-20 21:41:59 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-03-21 21:45:31 -0700 |
commit | 56c874f7dbcab2ab5cf8055d46a2ef36dec3d664 (patch) | |
tree | ebd75ecb6b16964eec2d8c7254b81e534ca28e8b /tools/net | |
parent | 85496c9b3bf8dbe15e2433d3a0197954d323cadc (diff) |
tools: ynl: skip the explicit op array size when not needed
Jiri suggests it reads more naturally to skip the explicit
array size when possible. When we export the symbol we want
to make sure that the size is right but for statics its
not needed.
Link: https://lore.kernel.org/r/20230321044159.1031040-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net')
-rwxr-xr-x | tools/net/ynl/ynl-gen-c.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index c16671a02621..972b87c7aaaf 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -1696,7 +1696,9 @@ def print_kernel_op_table_fwd(family, cw, terminate): 'split': 'genl_split_ops'} struct_type = pol_to_struct[family.kernel_policy] - if family.kernel_policy == 'split': + if not exported: + cnt = "" + elif family.kernel_policy == 'split': cnt = 0 for op in family.ops.values(): if 'do' in op: |