summaryrefslogtreecommitdiff
path: root/tools/net
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-08-08 11:03:44 +0200
committerJakub Kicinski <kuba@kernel.org>2023-08-09 13:03:32 -0700
commit2c0e9f3806c46976e9d34130dcb4550ac114293a (patch)
treef88d81b84dd179c539b7fcfb7334e53e686efc6e /tools/net
parentd8c21ef7b2b147a7e0d0497da120a3bc73be7fbe (diff)
tools: ynl-gen: avoid rendering empty validate field
When dont-validate flags are filtered out for do/dump op, the list may be empty. In that case, avoid rendering the validate field. Fixes: fa8ba3502ade ("ynl-gen-c.py: render netlink policies static for split ops") Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230808090344.1368874-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net')
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index e64311331726..6b9d9380a6ab 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -2000,9 +2000,10 @@ def print_kernel_op_table(family, cw):
continue
dont_validate.append(x)
- members.append(('validate',
- ' | '.join([c_upper('genl-dont-validate-' + x)
- for x in dont_validate])), )
+ if dont_validate:
+ members.append(('validate',
+ ' | '.join([c_upper('genl-dont-validate-' + x)
+ for x in dont_validate])), )
name = c_lower(f"{family.name}-nl-{op_name}-{op_mode}it")
if 'pre' in op[op_mode]:
members.append((cb_names[op_mode]['pre'], c_lower(op[op_mode]['pre'])))