* Re: [PATCH net-next v3 04/13] tools: ynl-gen: refactor local vars for .attr_put() callers [not found] ` <20250911200508.79341-5-ast@fiberby.net> @ 2025-09-13 0:19 ` Jakub Kicinski 0 siblings, 0 replies; 4+ messages in thread From: Jakub Kicinski @ 2025-09-13 0:19 UTC (permalink / raw) To: Asbjørn Sloth Tønnesen Cc: Jason A. Donenfeld, David S. Miller, Eric Dumazet, Paolo Abeni, Donald Hunter, Simon Horman, Jacob Keller, Sabrina Dubroca, wireguard, netdev, linux-kernel On Thu, 11 Sep 2025 20:04:57 +0000 Asbjørn Sloth Tønnesen wrote: > + def attr_put_local_vars(self): > + local_vars = [] > + if self.presence_type() == 'count': > + local_vars.append('unsigned int i;') > + return local_vars > + > def attr_put(self, ri, var): > raise Exception(f"Put not implemented for class type {self.type}") > > @@ -840,6 +846,10 @@ class TypeArrayNest(Type): > '}'] > return get_lines, None, local_vars > > + def attr_put_local_vars(self): > + local_vars = ['struct nlattr *array;'] > + return local_vars + super().attr_put_local_vars() Doesn't feel right. The Type method is a helper which is compatible with the specific types by checking presence, then you override it, and on top of that combine the output with super(). I don't like. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20250911200508.79341-6-ast@fiberby.net>]
* Re: [PATCH net-next v3 05/13] tools: ynl-gen: add CodeWriter.p_lines() helper [not found] ` <20250911200508.79341-6-ast@fiberby.net> @ 2025-09-13 0:21 ` Jakub Kicinski 0 siblings, 0 replies; 4+ messages in thread From: Jakub Kicinski @ 2025-09-13 0:21 UTC (permalink / raw) To: Asbjørn Sloth Tønnesen Cc: Jason A. Donenfeld, David S. Miller, Eric Dumazet, Paolo Abeni, Donald Hunter, Simon Horman, Jacob Keller, Sabrina Dubroca, wireguard, netdev, linux-kernel On Thu, 11 Sep 2025 20:04:58 +0000 Asbjørn Sloth Tønnesen wrote: > Add a helper for writing an array of lines, and convert > all the existing loops doing that, to use the new helper. > > This is a trivial patch with no behavioural changes intended, > there are no changes to the generated code. I don't see the need for this. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20250911200508.79341-7-ast@fiberby.net>]
* Re: [PATCH net-next v3 06/13] tools: ynl-gen: deduplicate fixed_header handling [not found] ` <20250911200508.79341-7-ast@fiberby.net> @ 2025-09-13 0:24 ` Jakub Kicinski 0 siblings, 0 replies; 4+ messages in thread From: Jakub Kicinski @ 2025-09-13 0:24 UTC (permalink / raw) To: Asbjørn Sloth Tønnesen Cc: Jason A. Donenfeld, David S. Miller, Eric Dumazet, Paolo Abeni, Donald Hunter, Simon Horman, Jacob Keller, Sabrina Dubroca, wireguard, netdev, linux-kernel On Thu, 11 Sep 2025 20:04:59 +0000 Asbjørn Sloth Tønnesen wrote: > Fixed headers are handled nearly identical in print_dump(), > print_req() and put_req_nested(), generalize them and use a > common function to generate them. > > This only causes cosmetic changes to tc_netem_attrs_put() in > tc-user.c. > > Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> > --- > tools/net/ynl/pyynl/ynl_gen_c.py | 39 ++++++++++++++++---------------- > 1 file changed, 20 insertions(+), 19 deletions(-) This only makes the code longer and harder to follow. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20250911200508.79341-9-ast@fiberby.net>]
* Re: [PATCH net-next v3 08/13] tools: ynl-gen: only validate nested array payload [not found] ` <20250911200508.79341-9-ast@fiberby.net> @ 2025-09-13 0:27 ` Jakub Kicinski 0 siblings, 0 replies; 4+ messages in thread From: Jakub Kicinski @ 2025-09-13 0:27 UTC (permalink / raw) To: Asbjørn Sloth Tønnesen Cc: Jason A. Donenfeld, David S. Miller, Eric Dumazet, Paolo Abeni, Donald Hunter, Simon Horman, Jacob Keller, Sabrina Dubroca, wireguard, netdev, linux-kernel On Thu, 11 Sep 2025 20:05:01 +0000 Asbjørn Sloth Tønnesen wrote: > +int ynl_attr_validate_payload(struct ynl_parse_arg *yarg, > + const struct nlattr *attr, unsigned int type) > +{ > + return __ynl_attr_validate(yarg, attr, type); > +} Why not expose __ynl_attr_validate() to the callers? I don't think the _payload() suffix is crystal clear, we're still validating attr, _payload() makes it sound like we're validating what's inside attr? ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-13 0:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20250911200508.79341-1-ast@fiberby.net>
[not found] ` <20250911200508.79341-5-ast@fiberby.net>
2025-09-13 0:19 ` [PATCH net-next v3 04/13] tools: ynl-gen: refactor local vars for .attr_put() callers Jakub Kicinski
[not found] ` <20250911200508.79341-6-ast@fiberby.net>
2025-09-13 0:21 ` [PATCH net-next v3 05/13] tools: ynl-gen: add CodeWriter.p_lines() helper Jakub Kicinski
[not found] ` <20250911200508.79341-7-ast@fiberby.net>
2025-09-13 0:24 ` [PATCH net-next v3 06/13] tools: ynl-gen: deduplicate fixed_header handling Jakub Kicinski
[not found] ` <20250911200508.79341-9-ast@fiberby.net>
2025-09-13 0:27 ` [PATCH net-next v3 08/13] tools: ynl-gen: only validate nested array payload Jakub Kicinski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).