summaryrefslogtreecommitdiffstats
path: root/tools/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-06-01 19:35:41 -0700
committerJakub Kicinski <kuba@kernel.org>2023-06-02 22:10:46 -0700
commit67c65ce762adaf3515fe058538c0a7065dc9f2b4 (patch)
tree6cc74af50caec2fb5bec366ee4817004ab1c7b39 /tools/net
parent6ad49839ba9b44cf957555f2b0b4f8bc076db48f (diff)
downloadlinux-67c65ce762adaf3515fe058538c0a7065dc9f2b4.tar.gz
linux-67c65ce762adaf3515fe058538c0a7065dc9f2b4.tar.bz2
linux-67c65ce762adaf3515fe058538c0a7065dc9f2b4.zip
tools: ynl-gen: don't override pure nested struct
For pure structs (parsed nested attributes) we track what forms of the struct exist in request and reply directions. Make sure we don't overwrite the recorded struct each time, otherwise the information is lost. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net')
-rwxr-xr-xtools/net/ynl/ynl-gen-c.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py
index 11dcbfc21ecc..40f7c47407c8 100755
--- a/tools/net/ynl/ynl-gen-c.py
+++ b/tools/net/ynl/ynl-gen-c.py
@@ -825,7 +825,8 @@ class Family(SpecFamily):
inherit = set()
nested = spec['nested-attributes']
if nested not in self.root_sets:
- self.pure_nested_structs[nested] = Struct(self, nested, inherited=inherit)
+ if nested not in self.pure_nested_structs:
+ self.pure_nested_structs[nested] = Struct(self, nested, inherited=inherit)
if attr in rs_members['request']:
self.pure_nested_structs[nested].request = True
if attr in rs_members['reply']: