aboutsummaryrefslogtreecommitdiffstats
path: root/tools/net/ynl/pyynl/ynl_gen_c.py
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-04-10 01:46:56 +0000
committerJakub Kicinski <[email protected]>2025-04-11 03:14:41 +0000
commit882e7b1365cedae2bb956e17a65bb697cde35e84 (patch)
treeb2294c1caf635778e9ed9ff52d631e25ca9fc933 /tools/net/ynl/pyynl/ynl_gen_c.py
parenttools: ynl-gen: consider dump ops without a do "type-consistent" (diff)
downloadkernel-882e7b1365cedae2bb956e17a65bb697cde35e84.tar.gz
kernel-882e7b1365cedae2bb956e17a65bb697cde35e84.zip
tools: ynl-gen: use family c-name in notifications
Family names may include dashes. Fix notification handling code gen to the c-compatible name. Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Donald Hunter <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/net/ynl/pyynl/ynl_gen_c.py')
-rwxr-xr-xtools/net/ynl/pyynl/ynl_gen_c.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py
index efed498ccb35..a9966ff2a143 100755
--- a/tools/net/ynl/pyynl/ynl_gen_c.py
+++ b/tools/net/ynl/pyynl/ynl_gen_c.py
@@ -2726,7 +2726,7 @@ def render_user_family(family, cw, prototype):
return
if family.ntfs:
- cw.block_start(line=f"static const struct ynl_ntf_info {family['name']}_ntf_info[] = ")
+ cw.block_start(line=f"static const struct ynl_ntf_info {family.c_name}_ntf_info[] = ")
for ntf_op_name, ntf_op in family.ntfs.items():
if 'notify' in ntf_op:
op = family.ops[ntf_op['notify']]
@@ -2756,8 +2756,8 @@ def render_user_family(family, cw, prototype):
else:
cw.p('.hdr_len\t= sizeof(struct genlmsghdr),')
if family.ntfs:
- cw.p(f".ntf_info\t= {family['name']}_ntf_info,")
- cw.p(f".ntf_info_size\t= YNL_ARRAY_SIZE({family['name']}_ntf_info),")
+ cw.p(f".ntf_info\t= {family.c_name}_ntf_info,")
+ cw.p(f".ntf_info_size\t= YNL_ARRAY_SIZE({family.c_name}_ntf_info),")
cw.block_end(line=';')