Skip to content

Commit bf51d27

Browse files
LorenzoBianconikuba-moo
authored andcommitted
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: be5bea1 ("net: add basic C code generators for Netlink") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8f76a4f commit bf51d27

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/net/ynl/lib/nlspec.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,8 @@ def has_doc(self):
138138

139139
def get_mask(self):
140140
mask = 0
141-
idx = self.yaml.get('value-start', 0)
142-
for _ in self.entries.values():
143-
mask |= 1 << idx
144-
idx += 1
141+
for e in self.entries.values():
142+
mask += e.user_value()
145143
return mask
146144

147145

0 commit comments

Comments
 (0)