Thread (28 messages) 28 messages, 3 authors, 2025-09-13

Re: [PATCH net-next v3 06/13] tools: ynl-gen: deduplicate fixed_header handling

From: Asbjørn Sloth Tønnesen <hidden>
Date: 2025-09-13 23:14:57
Also in: lkml

On 9/13/25 12:24 AM, Jakub Kicinski wrote:
On Thu, 11 Sep 2025 20:04:59 +0000 Asbjørn Sloth Tønnesen wrote:
quoted
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 <redacted>
---
  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.
We have 3 functions using put_attr():
* put_req_nested()
* print_req()
* print_dump()

I was just trying to align them a bit more so that they don't
do the same thing in three different ways. I would prefer to
make these functions more aligned, as it will hopefully make
it easier avoid issue like the missing local variables for
.attr_put().

I agree these clean up patches would also fit better in a
dedicated cleanup series, the only reason that I added this to
this series, was because you pushed back, then I said that the
`len` dedup, and other "make code look natural" cleanups might
not be for this series.

I have dropped this patch in v4, it's not important for this
series.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help