diff mbox series

[net-next] ynl-gen-c.py: avoid rendering empty validate field

Message ID 20230808090344.1368874-1-jiri@resnulli.us (mailing list archive)
State Accepted
Commit 2c0e9f3806c46976e9d34130dcb4550ac114293a
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ynl-gen-c.py: avoid rendering empty validate field | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
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: 9 this patch: 9
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 9 this patch: 9
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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jiri Pirko Aug. 8, 2023, 9:03 a.m. UTC
From: Jiri Pirko <jiri@nvidia.com>

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>
---
 tools/net/ynl/ynl-gen-c.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jakub Kicinski Aug. 8, 2023, 11:21 p.m. UTC | #1
On Tue,  8 Aug 2023 11:03:44 +0200 Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> 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>
patchwork-bot+netdevbpf@kernel.org Aug. 9, 2023, 8:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  8 Aug 2023 11:03:44 +0200 you wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> 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>
> 
> [...]

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!
diff mbox series

Patch

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'])))