mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
tools: ynl-gen: array-nest: support arrays of nests
TC needs arrays of nests, but just a put for now. Fairly straightforward addition. Link: https://patch.msgid.link/20250513222011.844106-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
1119e5519d
commit
87948df5af
|
|
@ -825,6 +825,9 @@ class TypeArrayNest(Type):
|
|||
elif self.sub_type == 'binary' and 'exact-len' in self.checks:
|
||||
ri.cw.p(f'for (i = 0; i < {var}->_count.{self.c_name}; i++)')
|
||||
ri.cw.p(f"ynl_attr_put(nlh, i, {var}->{self.c_name}[i], {self.checks['exact-len']});")
|
||||
elif self.sub_type == 'nest':
|
||||
ri.cw.p(f'for (i = 0; i < {var}->_count.{self.c_name}; i++)')
|
||||
ri.cw.p(f"{self.nested_render_name}_put(nlh, i, &{var}->{self.c_name}[i]);")
|
||||
else:
|
||||
raise Exception(f"Put for ArrayNest sub-type {self.attr['sub-type']} not supported, yet")
|
||||
ri.cw.p('ynl_attr_nest_end(nlh, array);')
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user