From: Jakub Kicinski <kuba@kernel.org>
To: Simon Horman <horms@kernel.org>
Cc: "Donald Hunter" <donald.hunter@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Asbjørn Sloth Tønnesen" <ast@fiberby.net>,
"Chuck Lever" <cel@kernel.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] tools: ynl-gen: avoid shadow local variable declarations
Date: Fri, 20 Nov 2026 17:32:53 -0800 [thread overview]
Message-ID: <20261120173253.5dd0c949@kernel.org> (raw)
In-Reply-To: <20261119-ynl-scope-v1-1-d3b0c964d4cb@kernel.org>
On Thu, 19 Nov 2026 16:30:34 +0000 Simon Horman wrote:
> for arg in sorted(all_multi):
> - local_vars.append(f"unsigned int n_{struct[arg].c_name} = 0;")
> + aspec = struct[arg]
> + var_set |= set([f'unsigned int n_{struct[arg].c_name} = 0;'])
> + if aspec.type == 'binary' and 'struct' in aspec:
> + var_set |= set(['size_t size;'])
> + elif aspec.type == 'string':
> + var_set |= set(['unsigned int len;'])
tools/net/ynl/pyynl/ynl_gen_c.py:2222: [C405] Unnecessary list literal (rewrite as a set literal)
tools/net/ynl/pyynl/ynl_gen_c.py:2224: [C405] Unnecessary list literal (rewrite as a set literal)
tools/net/ynl/pyynl/ynl_gen_c.py:2226: [C405] Unnecessary list literal (rewrite as a set literal)
Please drop the Fixes tag when reposting, and you can add
Acked-by: Jakub Kicinski <kuba@kernel.org>
--
pw-bot: cr
prev parent reply other threads:[~2026-11-21 1:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 16:30 [PATCH net-next] tools: ynl-gen: avoid shadow local variable declarations Simon Horman
2026-11-21 1:32 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261120173253.5dd0c949@kernel.org \
--to=kuba@kernel.org \
--cc=ast@fiberby.net \
--cc=cel@kernel.org \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox