Re: [PATCH net-next v3 06/13] tools: ynl-gen: deduplicate fixed_header handling
Asbjørn Sloth Tønnesen <[email protected]> Sat, 13 Sep 2025 23:14:38 +0000
| Newsgroups | com.zx2c4.lists.wireguard,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
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: >> 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 <[email protected]> >> --- >> 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.