Skip to content

Commit

Permalink
ynl: skip rendering attributes with header property in uapi mode
Browse files Browse the repository at this point in the history
To allow omitting some of the attributes in the final generated file.

Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20241204155549.641348-3-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Stanislav Fomichev authored and Jakub Kicinski committed Dec 5, 2024
1 parent 523d3cc commit 8c843ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/net/ynl/ynl-gen-c.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ def __init__(self, family, yaml):
self.user_type = 'int'

self.value_pfx = yaml.get('name-prefix', f"{family.ident_name}-{yaml['name']}-")
self.header = yaml.get('header', None)
self.enum_cnt_name = yaml.get('enum-cnt-name', None)

super().__init__(family, yaml)
Expand Down Expand Up @@ -2441,6 +2442,9 @@ def render_uapi(family, cw):
if const['type'] == 'enum' or const['type'] == 'flags':
enum = family.consts[const['name']]

if enum.header:
continue

if enum.has_doc():
if enum.has_entry_doc():
cw.p('/**')
Expand Down

0 comments on commit 8c843ec

Please sign in to comment.