ynl: skip rendering attributes with header property in uapi mode

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>
This commit is contained in:
Stanislav Fomichev
2024-12-04 07:55:43 -08:00
committed by Jakub Kicinski
parent 523d3cc4b6
commit 8c843ecde4

View File

@@ -801,6 +801,7 @@ class EnumSet(SpecEnumSet):
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)
@@ -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('/**')