tools: ynl: skip the explicit op array size when no needed
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 tools: ynl: skip the explicit op array size when no 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.
Signed-off-by Jakub Kicinski <[email protected]>
--- net/core/netdev-genl-gen.c | 2 +- tools/net/ynl/ynl-gen-c.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
net/core/netdev-genl-gen.c +1 -1
@@ -16,7 +16,7 @@ static const struct nla_policy netdev_dev_get_nl_policy[NETDEV_A_DEV_IFINDEX + 1 };/* Ops table for netdev */ -static const struct genl_split_ops netdev_nl_ops[2 ] = { +static const struct genl_split_ops netdev_nl_ops[] = { { .cmd =NETDEV_CMD_DEV_GET , .doit = netdev_nl_dev_get_doit,
tools/net/ynl/ynl-gen-c.py +3 -1
@@ -1696,7 +1696,9 @@ _C_KW = { '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:
Signature · 1 line
2.39.2
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 Mon, 20 Mar 2023 21:41:59 -0700 you wrote:
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.
Signed-off-by Jakub Kicinski <[email protected]>--- net/core/netdev-genl-gen.c | 2 +- tools/net/ynl/ynl-gen-c.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
Here is the summary with links:
- [net-next] tools: ynl: skip the explicit op array size when no needed
https://git.kernel.org/netdev/net-next/c/56c874f7dbca
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html