tools: ynl: fix render-max for flags definition
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 9 Mar 2023 12:25:25 +0000 (13:25 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Mar 2023 05:33:47 +0000 (21:33 -0800)
commit8f76a4f80fba8096a611b6b60c40a0f4cab3ddfb
treecf4dd16aed15ea099f07b0222fb3560ca85618dc
parent7e4f8a0c495413a50413e8c9f1032ce1bc633bae
tools: ynl: fix render-max for flags definition

Properly manage render-max property for flags definition type
introducing mask value and setting it to (last_element << 1) - 1
instead of adding max value set to last_element + 1

Fixes: be5bea1cc0bf ("net: add basic C code generators for Netlink")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/ynl-gen-c.py