Commit bf51d277 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jakub Kicinski

tools: ynl: fix get_mask utility routine

Fix get_mask utility routine in order to take into account possible gaps
in the elements list.

Fixes: be5bea1c ("net: add basic C code generators for Netlink")
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8f76a4f8
...@@ -138,10 +138,8 @@ class SpecEnumSet(SpecElement): ...@@ -138,10 +138,8 @@ class SpecEnumSet(SpecElement):
def get_mask(self): def get_mask(self):
mask = 0 mask = 0
idx = self.yaml.get('value-start', 0) for e in self.entries.values():
for _ in self.entries.values(): mask += e.user_value()
mask |= 1 << idx
idx += 1
return mask return mask
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment