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

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
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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