netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Cc: donald.hunter@redhat.com, Donald Hunter <donald.hunter@gmail.com>
Subject: [PATCH net-next v5 01/10] tools/net/ynl: remove extraneous plural from variable names
Date: Tue, 11 Feb 2025 12:01:18 +0000	[thread overview]
Message-ID: <20250211120127.84858-2-donald.hunter@gmail.com> (raw)
In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com>

_decode_array_attr() uses variable subattrs in every branch when only
one branch decodes more than a single attribute.

Change the variable name to subattr in the branches that only decode a
single attribute so that the intent is more obvious.

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/net/ynl/pyynl/lib/ynl.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py
index 08f8bf89cfc2..8b39d8b1eaa8 100644
--- a/tools/net/ynl/pyynl/lib/ynl.py
+++ b/tools/net/ynl/pyynl/lib/ynl.py
@@ -644,15 +644,15 @@ class YnlFamily(SpecFamily):
                 subattrs = self._decode(NlAttrs(item.raw), attr_spec['nested-attributes'])
                 decoded.append({ item.type: subattrs })
             elif attr_spec["sub-type"] == 'binary':
-                subattrs = item.as_bin()
+                subattr = item.as_bin()
                 if attr_spec.display_hint:
-                    subattrs = self._formatted_string(subattrs, attr_spec.display_hint)
-                decoded.append(subattrs)
+                    subattr = self._formatted_string(subattr, attr_spec.display_hint)
+                decoded.append(subattr)
             elif attr_spec["sub-type"] in NlAttr.type_formats:
-                subattrs = item.as_scalar(attr_spec['sub-type'], attr_spec.byte_order)
+                subattr = item.as_scalar(attr_spec['sub-type'], attr_spec.byte_order)
                 if attr_spec.display_hint:
-                    subattrs = self._formatted_string(subattrs, attr_spec.display_hint)
-                decoded.append(subattrs)
+                    subattr = self._formatted_string(subattr, attr_spec.display_hint)
+                decoded.append(subattr)
             else:
                 raise Exception(f'Unknown {attr_spec["sub-type"]} with name {attr_spec["name"]}')
         return decoded
-- 
2.48.1


  reply	other threads:[~2025-02-11 12:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 12:01 [PATCH net-next v5 00/10] netlink: specs: add a spec for nl80211 wiphy Donald Hunter
2025-02-11 12:01 ` Donald Hunter [this message]
2025-02-11 12:01 ` [PATCH net-next v5 02/10] tools/net/ynl: support decoding indexed arrays as enums Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 03/10] tools/net/ynl: support rendering C array members to strings Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 04/10] tools/net/ynl: accept IP string inputs Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 05/10] tools/net/ynl: add s8, s16 to valid scalars in ynl-gen-c Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 06/10] tools/net/ynl: sanitise enums with leading digits " Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 07/10] tools/net/ynl: add indexed-array scalar support to ynl-gen-c Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 08/10] netlink: specs: support nested structs in genetlink legacy Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 09/10] netlink: specs: add s8, s16 to genetlink schemas Donald Hunter
2025-02-11 12:01 ` [PATCH net-next v5 10/10] netlink: specs: wireless: add a spec for nl80211 Donald Hunter
2025-05-03 20:07   ` Jakub Kicinski
2025-05-05  9:10     ` Johannes Berg
2025-02-13  3:40 ` [PATCH net-next v5 00/10] netlink: specs: add a spec for nl80211 wiphy patchwork-bot+netdevbpf

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=20250211120127.84858-2-donald.hunter@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-wireless@vger.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;
as well as URLs for NNTP newsgroup(s).