Message ID | 12a91d4e401c5390a34a3074fe9d8dfa41d43f35.1678200041.git.lorenzo@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | update xdp_features flag according to NIC re-configuration | expand |
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index f2e41dd962d4..0d6df9414aa9 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -652,10 +652,8 @@ class EnumSet: def get_mask(self): mask = 0 - idx = self.yaml.get('value-start', 0) - for _ in self.entry_list: - mask |= 1 << idx - idx += 1 + for e in self.entry_list: + mask += e.user_value() return mask
Fix get_mask utility routine in order to take into account possible gaps in the elements list. Fixes: be5bea1cc0bf ("net: add basic C code generators for Netlink") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- tools/net/ynl/ynl-gen-c.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)