mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
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: be5bea1cc0
("net: add basic C code generators for Netlink")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
8f76a4f80f
commit
bf51d27704
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user