diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-12-14 02:14:26 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-12-15 04:51:21 +0300 |
commit | 139c163b5b0b7095bf88415da030795c403baa33 (patch) | |
tree | 377fadab53929ec40624be709851a4e410e47239 /tools/net | |
parent | 4dc27587dcbaf9f6229222ba015344c0edce24c9 (diff) | |
download | linux-139c163b5b0b7095bf88415da030795c403baa33.tar.xz |
tools: ynl-gen: use enum user type for members and args
Commit 30c902001534 ("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>
Diffstat (limited to 'tools/net')
-rwxr-xr-x | tools/net/ynl/ynl-gen-c.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index 9484882dbc2e..ab009d0f9db5 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -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: |