mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
tools: ynl-gen: use enum user type for members and args
Commit 30c9020015
("tools: ynl-gen: use enum name from the spec")
added pre-cooked user type for enums. Use it to fix ignoring
enum-name provided in the spec.
This changes a type in struct ethtool_tunnel_udp_entry but is
generally inconsequential for current families.
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20231213231432.2944749-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
4dc27587dc
commit
139c163b5b
1 changed files with 2 additions and 3 deletions
|
@ -333,9 +333,8 @@ class TypeScalar(Type):
|
|||
else:
|
||||
self.is_bitfield = False
|
||||
|
||||
maybe_enum = not self.is_bitfield and 'enum' in self.attr
|
||||
if maybe_enum and self.family.consts[self.attr['enum']].enum_name:
|
||||
self.type_name = c_lower(f"enum {self.family.name}_{self.attr['enum']}")
|
||||
if not self.is_bitfield and 'enum' in self.attr:
|
||||
self.type_name = self.family.consts[self.attr['enum']].user_type
|
||||
elif self.is_auto_scalar:
|
||||
self.type_name = '__' + self.type[0] + '64'
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue