All of lore.kernel.org
 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>, Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org,
	Jacob Keller <jacob.e.keller@intel.com>,
	Breno Leitao <leitao@debian.org>
Cc: donald.hunter@redhat.com, Donald Hunter <donald.hunter@gmail.com>
Subject: [PATCH net-next v5 01/13] tools/net/ynl: Use consistent array index expression formatting
Date: Fri, 15 Dec 2023 09:37:08 +0000	[thread overview]
Message-ID: <20231215093720.18774-2-donald.hunter@gmail.com> (raw)
In-Reply-To: <20231215093720.18774-1-donald.hunter@gmail.com>

Use expression formatting that conforms to the python style guide.

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

diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
index 92995bca14e1..5c48f0c9713c 100644
--- a/tools/net/ynl/lib/ynl.py
+++ b/tools/net/ynl/lib/ynl.py
@@ -98,12 +98,12 @@ class NlAttr:
     }
 
     def __init__(self, raw, offset):
-        self._len, self._type = struct.unpack("HH", raw[offset:offset + 4])
+        self._len, self._type = struct.unpack("HH", raw[offset : offset + 4])
         self.type = self._type & ~Netlink.NLA_TYPE_MASK
         self.is_nest = self._type & Netlink.NLA_F_NESTED
         self.payload_len = self._len
         self.full_len = (self.payload_len + 3) & ~3
-        self.raw = raw[offset + 4:offset + self.payload_len]
+        self.raw = raw[offset + 4 : offset + self.payload_len]
 
     @classmethod
     def get_format(cls, attr_type, byte_order=None):
@@ -154,7 +154,7 @@ class NlAttr:
         for m in members:
             # TODO: handle non-scalar members
             if m.type == 'binary':
-                decoded = self.raw[offset:offset+m['len']]
+                decoded = self.raw[offset : offset + m['len']]
                 offset += m['len']
             elif m.type in NlAttr.type_formats:
                 format = self.get_format(m.type, m.byte_order)
@@ -193,12 +193,12 @@ class NlAttrs:
 
 class NlMsg:
     def __init__(self, msg, offset, attr_space=None):
-        self.hdr = msg[offset:offset + 16]
+        self.hdr = msg[offset : offset + 16]
 
         self.nl_len, self.nl_type, self.nl_flags, self.nl_seq, self.nl_portid = \
             struct.unpack("IHHII", self.hdr)
 
-        self.raw = msg[offset + 16:offset + self.nl_len]
+        self.raw = msg[offset + 16 : offset + self.nl_len]
 
         self.error = 0
         self.done = 0
-- 
2.42.0


  reply	other threads:[~2023-12-15  9:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15  9:37 [PATCH net-next v5 00/13] tools/net/ynl: Add 'sub-message' support to ynl Donald Hunter
2023-12-15  9:37 ` Donald Hunter [this message]
2023-12-15  9:37 ` [PATCH net-next v5 02/13] doc/netlink: Add sub-message support to netlink-raw Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 03/13] doc/netlink: Document the sub-message format for netlink-raw Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 04/13] tools/net/ynl: Add 'sub-message' attribute decoding to ynl Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 05/13] tools/net/ynl: Add binary and pad support to structs for tc Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 06/13] doc/netlink/specs: Add sub-message type to rt_link family Donald Hunter
2024-02-13 12:48   ` Jiri Pirko
2023-12-15  9:37 ` [PATCH net-next v5 07/13] doc/netlink/specs: use pad in structs in rt_link Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 08/13] doc/netlink/specs: Add a spec for tc Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 09/13] doc/netlink: Regenerate netlink .rst files if ynl-gen-rst changes Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 10/13] tools/net/ynl-gen-rst: Add sub-messages to generated docs Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 11/13] tools/net/ynl-gen-rst: Sort the index of generated netlink specs Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 12/13] tools/net/ynl-gen-rst: Remove bold from attribute-set headings Donald Hunter
2023-12-15  9:37 ` [PATCH net-next v5 13/13] tools/net/ynl-gen-rst: Remove extra indentation from generated docs Donald Hunter
2023-12-18 23:10 ` [PATCH net-next v5 00/13] tools/net/ynl: Add 'sub-message' support to ynl 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=20231215093720.18774-2-donald.hunter@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@redhat.com \
    --cc=edumazet@google.com \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-doc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.