tools: ynl: fix converting flags to names after recent cleanup
Subsystems (3)
Jakub Kicinski
maintainerPATCH 1/1 tools: ynl: fix converting flags to names after recent cleanup
I recently cleaned up specs to not specify enum-as-flags when target enum is already defined as flags. YNL Python library did not convert flags, unfortunately, so this caused breakage for Stan and Willem.
Note that the nlspec.py abstraction already hides the differences between flags and enums (value vs user_value), so the changes are pretty trivial.
---
CC: [email protected]
CC: [email protected]
--- tools/net/ynl/lib/ynl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/net/ynl/lib/ynl.py +1 -1
@@ -486,7 +486,7 @@ genl_family_name_to_id = None def _decode_enum(self, raw, attr_spec): enum = self.consts[attr_spec['enum']] - if 'enum-as-flags' in attr_spec and attr_spec['enum-as-flags']: + if enum.type == 'flags' or attr_spec.get('enum-as-flags', False): i = 0 value = set() while raw:
Signature · 1 line
2.41.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 16 Oct 2023 14:39:37 -0700 you wrote:
I recently cleaned up specs to not specify enum-as-flags when target enum is already defined as flags. YNL Python library did not convert flags, unfortunately, so this caused breakage for Stan and Willem.
Note that the
nlspec.pyabstraction already hides the differences between flags and enums (value vsuser_value), so the changes are pretty trivial.[...]
Here is the summary with links:
- [net-next] tools: ynl: fix converting flags to names after recent cleanup
https://git.kernel.org/netdev/net-next/c/9fea94d3a8ca
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html