Skip to contentSkip to conversation

ynl-gen-c.py: avoid rendering empty validate field

PATCH Applied Jiri Pirko 3 participants 3 messages Aug 8, 2023 – Aug 9, 2023

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 ynl-gen-c.py: avoid rendering empty validate field

From: Jiri Pirko <[email protected]>

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")
---
 tools/net/ynl/ynl-gen-c.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tools/net/ynl/ynl-gen-c.py +4 -3
index e64311331726..6b9d9380a6ab 100755
@@ -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'])))
Signature · 1 line
2.41.0
#2 lore raw
In reply to Jiri Pirko
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Tue, 8 Aug 2023 11:03:44 +0200 you wrote:

From: Jiri Pirko <[email protected]>

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")

[...]

Here is the summary with links:
- [net-next] ynl-gen-c.py: avoid rendering empty validate field

    https://git.kernel.org/netdev/net-next/c/2c0e9f3806c4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html