Message ID | 31613fd1f414d8d4d0b82e7dd1d60c6d087bd0d5.1678364613.git.lorenzo@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | bf51d27704c963ea52c0843096e23c9f404b13af |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | update xdp_features flag according to NIC re-configuration | expand |
diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/lib/nlspec.py index a34d088f6743..960a356e8225 100644 --- a/tools/net/ynl/lib/nlspec.py +++ b/tools/net/ynl/lib/nlspec.py @@ -138,10 +138,8 @@ class SpecEnumSet(SpecElement): def get_mask(self): mask = 0 - idx = self.yaml.get('value-start', 0) - for _ in self.entries.values(): - mask |= 1 << idx - idx += 1 + for e in self.entries.values(): + 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/lib/nlspec.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)